UNPKG

@finsweet/fluid-design-generator

Version:

Fluid design generator tool for Webflow sites.

1 lines 79.8 kB
function e(){}function t(e){return e()}function n(){return Object.create(null)}function r(e){e.forEach(t)}function o(e){return"function"==typeof e}function i(e,t){return e!=e?t==t:e!==t||e&&"object"==typeof e||"function"==typeof e}function a(t,...n){if(null==t)return e;const r=t.subscribe(...n);return r.unsubscribe?()=>r.unsubscribe():r}function s(e){let t;return a(e,(e=>t=e))(),t}function c(e,t,n){e.$$.on_destroy.push(a(t,n))}function l(e,t,n){return e.set(n),t}function u(e,t){e.appendChild(t)}function d(e,t,n){e.insertBefore(t,n||null)}function f(e){e.parentNode.removeChild(e)}function g(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function p(e){return document.createElement(e)}function m(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function h(e){return document.createTextNode(e)}function b(){return h(" ")}function y(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function v(e,t,n){null==n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function w(e){return""===e?null:+e}function $(e,t){t=""+t,e.wholeText!==t&&(e.data=t)}function x(e,t){e.value=null==t?"":t}function k(e,t,n){e.classList[n?"add":"remove"](t)}let E;function _(e){E=e}function A(){if(!E)throw new Error("Function called outside component initialization");return E}function T(e){A().$$.on_mount.push(e)}function S(){const e=A();return(t,n)=>{const r=e.$$.callbacks[t];if(r){const o=function(e,t,n=!1){const r=document.createEvent("CustomEvent");return r.initCustomEvent(e,n,!1,t),r}(t,n);r.slice().forEach((t=>{t.call(e,o)}))}}}const N=[],O=[],M=[],C=[],R=Promise.resolve();let j=!1;function L(){j||(j=!0,R.then(D))}function I(e){M.push(e)}function F(e){C.push(e)}const B=new Set;let z=0;function D(){const e=E;do{for(;z<N.length;){const e=N[z];z++,_(e),P(e.$$)}for(_(null),N.length=0,z=0;O.length;)O.pop()();for(let e=0;e<M.length;e+=1){const t=M[e];B.has(t)||(B.add(t),t())}M.length=0}while(N.length);for(;C.length;)C.pop()();j=!1,B.clear(),_(e)}function P(e){if(null!==e.fragment){e.update(),r(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(I)}}const H=new Set;let U;function Z(){U={r:0,c:[],p:U}}function W(){U.r||r(U.c),U=U.p}function G(e,t){e&&e.i&&(H.delete(e),e.i(t))}function V(e,t,n,r){if(e&&e.o){if(H.has(e))return;H.add(e),U.c.push((()=>{H.delete(e),r&&(n&&e.d(1),r())})),e.o(t)}}function K(e,t,n){const r=e.$$.props[t];void 0!==r&&(e.$$.bound[r]=n,n(e.$$.ctx[r]))}function X(e){e&&e.c()}function q(e,n,i,a){const{fragment:s,on_mount:c,on_destroy:l,after_update:u}=e.$$;s&&s.m(n,i),a||I((()=>{const n=c.map(t).filter(o);l?l.push(...n):r(n),e.$$.on_mount=[]})),u.forEach(I)}function J(e,t){const n=e.$$;null!==n.fragment&&(r(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function Y(t,o,i,a,s,c,l,u=[-1]){const d=E;_(t);const g=t.$$={fragment:null,ctx:null,props:c,update:e,not_equal:s,bound:n(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(o.context||(d?d.$$.context:[])),callbacks:n(),dirty:u,skip_bound:!1,root:o.target||d.$$.root};l&&l(g.root);let p=!1;if(g.ctx=i?i(t,o.props||{},((e,n,...r)=>{const o=r.length?r[0]:n;return g.ctx&&s(g.ctx[e],g.ctx[e]=o)&&(!g.skip_bound&&g.bound[e]&&g.bound[e](o),p&&function(e,t){-1===e.$$.dirty[0]&&(N.push(e),L(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}(t,e)),n})):[],g.update(),p=!0,r(g.before_update),g.fragment=!!a&&a(g.ctx),o.target){if(o.hydrate){const e=function(e){return Array.from(e.childNodes)}(o.target);g.fragment&&g.fragment.l(e),e.forEach(f)}else g.fragment&&g.fragment.c();o.intro&&G(t.$$.fragment),q(t,o.target,o.anchor,o.customElement),D()}_(d)}class Q{$destroy(){J(this,1),this.$destroy=e}$on(e,t){const n=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return n.push(t),()=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1)}}$set(e){var t;this.$$set&&(t=e,0!==Object.keys(t).length)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}function ee(t){let n,r,o;return{c(){n=m("svg"),r=m("path"),o=m("path"),v(r,"d","M2.96288 8.18639C2.74725 7.9539 2.62744 7.64851 2.62744 7.33141C2.62744 7.01432 2.74725 6.70894 2.96288 6.47644L7.99217 1.34657C8.10192 1.2367 8.23227 1.14954 8.37573 1.09007C8.5192 1.03061 8.67298 1 8.82829 1C8.98358 1 9.13736 1.03061 9.28084 1.09007C9.4243 1.14954 9.55464 1.2367 9.66441 1.34657C9.88003 1.57907 9.99984 1.88445 9.99984 2.20155C9.99984 2.51864 9.88003 2.82403 9.66441 3.05652L4.63512 8.18639C4.40485 8.39142 4.1073 8.5047 3.799 8.5047C3.49069 8.5047 3.19314 8.39142 2.96288 8.18639Z"),v(o,"d","M0.335439 3.86122C0.445201 3.75135 0.575541 3.66419 0.719007 3.60472C0.862474 3.54526 1.01625 3.51465 1.17156 3.51465C1.32686 3.51465 1.48064 3.54526 1.6241 3.60472C1.76758 3.66419 1.89791 3.75135 2.00767 3.86122L4.64805 6.47645C4.86368 6.70895 4.98349 7.01433 4.98349 7.33142C4.98349 7.64852 4.86368 7.95391 4.64805 8.1864C4.41702 8.39492 4.11686 8.51034 3.80564 8.51034C3.49443 8.51034 3.19408 8.39492 2.96305 8.1864L0.335439 5.57117C0.119813 5.33868 0 5.03329 0 4.7162C0 4.3991 0.119813 4.09372 0.335439 3.86122Z"),v(n,"viewBox","0 0 10 10"),v(n,"fill","currentColor"),v(n,"xmlns","http://www.w3.org/2000/svg")},m(e,t){d(e,n,t),u(n,r),u(n,o)},p:e,i:e,o:e,d(e){e&&f(n)}}}class te extends Q{constructor(e){super(),Y(this,e,null,ee,i,{})}}function ne(t){let n,r,o;return{c(){n=m("svg"),r=m("path"),o=m("path"),v(r,"d","M2.14845 0.379729C1.65524 -0.113093 0.857561 -0.115071 0.366788 0.375312C-0.123984 0.865694 -0.122005 1.66274 0.371209 2.15556L7.85155 9.62996C8.34476 10.1228 9.14244 10.1248 9.63321 9.63438C10.124 9.144 10.122 8.34695 9.62879 7.85413L2.14845 0.379729Z"),v(o,"d","M7.85155 0.370914L0.371209 7.84532C-0.122005 8.33814 -0.123984 9.13518 0.366788 9.62557C0.857561 10.1159 1.65524 10.114 2.14845 9.62115L9.62879 2.14675C10.122 1.65393 10.124 0.85688 9.63321 0.366497C9.14244 -0.123886 8.34476 -0.121908 7.85155 0.370914Z"),v(n,"viewBox","0 0 10 10"),v(n,"fill","currentColor"),v(n,"xmlns","http://www.w3.org/2000/svg")},m(e,t){d(e,n,t),u(n,r),u(n,o)},p:e,i:e,o:e,d(e){e&&f(n)}}}class re extends Q{constructor(e){super(),Y(this,e,null,ne,i,{})}}function oe(e){let t,n,o,i,a,s,c,l,g,m,w,x,E,_,A,T,S,N,O,M;return w=new te({}),_=new re({}),{c(){t=p("div"),n=p("label"),o=p("input"),i=b(),a=p("div"),s=b(),c=p("div"),l=b(),g=p("div"),m=p("div"),X(w.$$.fragment),x=b(),E=p("div"),X(_.$$.fragment),A=b(),T=p("div"),S=h(e[2]),v(o,"type","checkbox"),v(o,"name",e[1]),o.disabled=e[3],v(o,"id",e[1]),v(o,"class","w-checkbox-input fs-fdg_switch-checkbox"),v(a,"class","fs-fdg_switch-bg"),v(c,"class","fs-fdg_switch"),v(m,"class","fs-fdg_switch-icon"),v(E,"class","fs-fdg_switch-icon is-off"),v(g,"class","fs-fdg_switch-icons"),v(n,"class","w-checkbox fs-fdg_switch-wrapper"),v(t,"class","fs-fdg_toggle"),k(t,"disabled",e[3])},m(r,f){d(r,t,f),u(t,n),u(n,o),o.checked=e[0],u(n,i),u(n,a),u(n,s),u(n,c),u(n,l),u(n,g),u(g,m),q(w,m,null),u(g,x),u(g,E),q(_,E,null),u(t,A),u(t,T),u(T,S),N=!0,O||(M=[y(o,"change",e[5]),y(t,"click",e[4])],O=!0)},p(e,[n]){(!N||2&n)&&v(o,"name",e[1]),(!N||8&n)&&(o.disabled=e[3]),(!N||2&n)&&v(o,"id",e[1]),1&n&&(o.checked=e[0]),(!N||4&n)&&$(S,e[2]),8&n&&k(t,"disabled",e[3])},i(e){N||(G(w.$$.fragment,e),G(_.$$.fragment,e),N=!0)},o(e){V(w.$$.fragment,e),V(_.$$.fragment,e),N=!1},d(e){e&&f(t),J(w),J(_),O=!1,r(M)}}}function ie(e,t,n){let{checked:r}=t,{name:o}=t,{description:i}=t,{disabled:a=!1}=t;return e.$$set=e=>{"checked"in e&&n(0,r=e.checked),"name"in e&&n(1,o=e.name),"description"in e&&n(2,i=e.description),"disabled"in e&&n(3,a=e.disabled)},[r,o,i,a,({target:e})=>{a||e instanceof Element&&e.closest("input")||n(0,r=!r)},function(){r=this.checked,n(0,r)}]}class ae extends Q{constructor(e){super(),Y(this,e,ie,oe,i,{checked:0,name:1,description:2,disabled:3})}}function se(e){if("object"!=typeof e)return e;var t,n,r=Object.prototype.toString.call(e);if("[object Object]"===r){if(e.constructor!==Object&&"function"==typeof e.constructor)for(t in n=new e.constructor,e)e.hasOwnProperty(t)&&n[t]!==e[t]&&(n[t]=se(e[t]));else for(t in n={},e)"__proto__"===t?Object.defineProperty(n,t,{value:se(e[t]),configurable:!0,enumerable:!0,writable:!0}):n[t]=se(e[t]);return n}if("[object Array]"===r){for(t=e.length,n=Array(t);t--;)n[t]=se(e[t]);return n}return"[object Set]"===r?(n=new Set,e.forEach((function(e){n.add(se(e))})),n):"[object Map]"===r?(n=new Map,e.forEach((function(e,t){n.set(se(t),se(e))})),n):"[object Date]"===r?new Date(+e):"[object RegExp]"===r?((n=new RegExp(e.source,e.flags)).lastIndex=e.lastIndex,n):"[object DataView]"===r?new e.constructor(se(e.buffer)):"[object ArrayBuffer]"===r?e.slice(0):"Array]"===r.slice(-6)?new e.constructor(e):e}const ce=[];function le(t,n=e){let r;const o=new Set;function a(e){if(i(t,e)&&(t=e,r)){const e=!ce.length;for(const e of o)e[1](),ce.push(e,t);if(e){for(let e=0;e<ce.length;e+=2)ce[e][0](ce[e+1]);ce.length=0}}}return{set:a,update:function(e){a(e(t))},subscribe:function(i,s=e){const c=[i,s];return o.add(c),1===o.size&&(r=n(a)||e),i(t),()=>{o.delete(c),0===o.size&&(r(),r=null)}}}}function ue(t,n,i){const s=!Array.isArray(t),c=s?[t]:t,l=n.length<2;return u=t=>{let i=!1;const u=[];let d=0,f=e;const g=()=>{if(d)return;f();const r=n(s?u[0]:u,t);l?t(r):f=o(r)?r:e},p=c.map(((e,t)=>a(e,(e=>{u[t]=e,d&=~(1<<t),i&&g()}),(()=>{d|=1<<t}))));return i=!0,g(),function(){r(p),f()}},{subscribe:le(i,u).subscribe};var u}const de=[{breakpointFrom:1,fontFrom:12,fontTo:16},{breakpointFrom:479,fontFrom:14,fontTo:16},{fontFrom:16,fontTo:18,breakpointFrom:1440}],fe=(()=>{const{subscribe:e,set:t,update:n}=le(se(de));return{set:t,update:n,subscribe:e,updateFont:(e,t,r,o)=>{n((n=>(r<0?r=0:o&&(r=Math.round(r/o)*o),n[e][t]=r,n)))},addBreakpoint:e=>{n((t=>{var n;"number"!=typeof e&&(e=t.length-1);const{breakpointFrom:r,fontFrom:o,fontTo:i}=t[e],a=s(ge),c=(null===(n=t[e+1])||void 0===n?void 0:n.breakpointFrom)||a,l=Math.round(r+(c-r)/2);return t.splice(e+1,0,{fontTo:i,fontFrom:o,breakpointFrom:l}),t}))},updateBreakpoint:(e,t)=>{0!==e&&n((n=>{var r;const o=s(ge),i=n[e-1].breakpointFrom,a=(null===(r=n[e+1])||void 0===r?void 0:r.breakpointFrom)||o;return n[e].breakpointFrom=t<=i?i+1:t>=a?a-1:t,n}))},removeBreakpoint:e=>{n((t=>{if(t.length<=1)return t;if("number"!=typeof e){e=t.length-1;const{breakpointFrom:n}=t[e];(L(),R).then((()=>ge.set(n)))}return t.splice(e,1),t}))},reset:()=>{t(se(de)),ge.set(1920)}}})(),ge=(()=>{const e=le(1920),{subscribe:t,set:n,update:r}=e;return{subscribe:t,set:n,updateValue:e=>{r((t=>{if(e===t)return t;const n=s(fe),r=n[n.length-1].breakpointFrom,o=r+1;return e<=r?o===t?t+1:o:e}))}}})(),pe=le(!1),me=le(!1),he=le(!1),be=({breakpointFrom:e,breakpointTo:t,fontFrom:n,fontTo:r},o)=>{const i=e/100,a=t/100,s=(r-n)/(a-i),c=(n-i*s)/16,l=o?38.4:a;return{fontFromREM:n/16,coefficient:s,base:c,warning:72*c+s*l<2*(16*c+s*l)}},ye=ue([fe,ge],(([e,t])=>e.map(((n,r)=>{var o;const i=(null===(o=e[r+1])||void 0===o?void 0:o.breakpointFrom)||t,a=Object.assign(Object.assign({},n),{breakpointTo:i}),s=be(a);return Object.assign(Object.assign({},a),s)})))),ve=ue([fe,ge,pe],(([e,t,n])=>{const r=e[e.length-1],o=r.fontTo,i={fontFrom:o,fontTo:n?o:2*o-r.fontFrom,breakpointFrom:t,breakpointTo:2*t-r.breakpointFrom},a=be(i,!0);return Object.assign(Object.assign({},i),a)})),we=ue([ye,ve],(([e,t])=>[...e,t])),$e=ue([we,me,he],(([e,t,n])=>{const r=e.map(((n,r)=>{const o=r===e.length-1,i=(({fontFrom:e,fontTo:t,index:n,fontFromREM:r,breakpointFrom:o,breakpointTo:i,isLast:a})=>{let s=" ";return s+=e===t?`--font-size-${n}: ${r};`:[`--font-from-${n}: ${e};`,`--font-to-${n}: ${t};`,`--vw-from-${n}: calc(${o} / 100);`,`--vw-to-${n}: calc(${i} / 100);`,`--coefficient-${n}: calc((var(--font-to-${n}) - var(--font-from-${n})) / (var(--vw-to-${n}) - var(--vw-from-${n})));`,`--base-${n}: calc((var(--font-from-${n}) - var(--vw-from-${n}) * var(--coefficient-${n})) / 16);`].join("\n "),a||(s+="\n\n"),s})(Object.assign(Object.assign({},n),{index:r,isLast:o})),a=(({fontFrom:e,fontTo:t,index:n,fontFromREM:r,breakpointTo:o,isLast:i,base:a,coefficient:s,$outputAsVariables:c})=>{let l=i?" ":"\n ";return i||(l+=`@media screen and (max-width:${o}px) { `),l+=c?e===t?`html { font-size: calc(var(--font-size-${n}) * 1rem); }`:`html { font-size: calc(var(--base-${n}) * 1rem + var(--coefficient-${n}) * 1vw); }`:e===t?`html { font-size: ${r}rem; }`:`html { font-size: calc(${a}rem + ${s}vw); }`,i||(l+=" }"),l})(Object.assign(Object.assign({},n),{isLast:o,index:r,$outputAsVariables:t}));return{variables:i,css:a}})),o=(({cssData:e,$outputAsVariables:t,$removeStyleTags:n})=>{let r=n?"":"<style>\n";if(t){r+=" :root {\n";for(const{variables:t}of e)r+=t;r+="\n }\n\n"}for(let t=e.length-1;t>=0;t--)r+=e[t].css;return r+=n?"\n":"\n</style>",r})({cssData:r,$outputAsVariables:t,$removeStyleTags:n});return o})),xe=ue(we,(e=>1.01*e.reduce(((e,{fontFrom:t,fontTo:n=0})=>{const r=Math.max(t,n);return r>e?r:e}),0)));function ke(t){let n,r,o;return{c(){n=m("svg"),r=m("path"),o=m("path"),v(r,"d","M7 1C7 0.447715 6.55228 0 6 0C5.44772 0 5 0.447715 5 1V11C5 11.5523 5.44772 12 6 12C6.55228 12 7 11.5523 7 11V1Z"),v(o,"d","M11 5H1C0.447715 5 0 5.44772 0 6C0 6.55228 0.447715 7 1 7H11C11.5523 7 12 6.55228 12 6C12 5.44772 11.5523 5 11 5Z"),v(n,"viewBox","0 0 12 12"),v(n,"fill","currentColor"),v(n,"xmlns","http://www.w3.org/2000/svg")},m(e,t){d(e,n,t),u(n,r),u(n,o)},p:e,i:e,o:e,d(e){e&&f(n)}}}class Ee extends Q{constructor(e){super(),Y(this,e,null,ke,i,{})}}function _e(e){let t,n,r,o;return n=new Ee({}),{c(){t=p("div"),X(n.$$.fragment),v(t,"class",r="fs-fdg_breakpoint-button is-"+e[0])},m(e,r){d(e,t,r),q(n,t,null),o=!0},p(e,[n]){(!o||1&n&&r!==(r="fs-fdg_breakpoint-button is-"+e[0]))&&v(t,"class",r)},i(e){o||(G(n.$$.fragment,e),o=!0)},o(e){V(n.$$.fragment,e),o=!1},d(e){e&&f(t),J(n)}}}function Ae(e,t,n){let{type:r}=t;return e.$$set=e=>{"type"in e&&n(0,r=e.type)},[r]}class Te extends Q{constructor(e){super(),Y(this,e,Ae,_e,i,{type:0})}}function Se(t){let n,r,o,i,a,s,c;return i=new Te({props:{type:"add"}}),{c(){n=p("div"),r=p("div"),r.textContent="Add breakpoint",o=b(),X(i.$$.fragment),v(r,"class","fs-fdg_breakpoint-add-text"),v(n,"class","fs-fdg_breakpoint-add")},m(e,l){d(e,n,l),u(n,r),u(n,o),q(i,n,null),a=!0,s||(c=y(n,"click",t[0]),s=!0)},p:e,i(e){a||(G(i.$$.fragment,e),a=!0)},o(e){V(i.$$.fragment,e),a=!1},d(e){e&&f(n),J(i),s=!1,c()}}}function Ne(e,t,n){let{index:r}=t;return e.$$set=e=>{"index"in e&&n(1,r=e.index)},[()=>{fe.addBreakpoint(r)},r]}class Oe extends Q{constructor(e){super(),Y(this,e,Ne,Se,i,{index:1})}}function Me(e,t,n){const r=e.slice();return r[15]=t[n],r}function Ce(e){let t,n=e[4],r=[];for(let t=0;t<n.length;t+=1)r[t]=Re(Me(e,n,t));return{c(){t=p("div");for(let e=0;e<r.length;e+=1)r[e].c();v(t,"class","fs-fdg_breakpoint-input-dropdown")},m(e,n){d(e,t,n);for(let e=0;e<r.length;e+=1)r[e].m(t,null)},p(e,o){if(144&o){let i;for(n=e[4],i=0;i<n.length;i+=1){const a=Me(e,n,i);r[i]?r[i].p(a,o):(r[i]=Re(a),r[i].c(),r[i].m(t,null))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(e){e&&f(t),g(r,e)}}}function Re(e){let t,n,r,o,i=e[15]+"";function a(){return e[11](e[15])}return{c(){t=p("div"),n=h(i),v(t,"class","fs-fdg_breakpoint-input-dropdown-item")},m(e,i){d(e,t,i),u(t,n),r||(o=y(t,"click",a),r=!0)},p(t,r){e=t,16&r&&i!==(i=e[15]+"")&&$(n,i)},d(e){e&&f(t),r=!1,o()}}}function je(t){let n,o,i,a,s,c,l,g,m=t[2]&&Ce(t);return{c(){n=p("div"),o=p("input"),i=b(),a=p("div"),s=h(t[1]),c=b(),m&&m.c(),v(o,"type","number"),v(o,"class","fs-fdg_breakpoint-input-field w-input"),v(o,"step","0.5"),v(o,"maxlength","5"),v(o,"name",t[0]),v(o,"id",t[0]),v(a,"class","fs-fdg_breakpoint-input-unit"),v(n,"class","fs-fdg_breakpoint-input")},m(e,r){d(e,n,r),u(n,o),x(o,t[3]),u(n,i),u(n,a),u(a,s),u(n,c),m&&m.m(n,null),l||(g=[y(o,"input",t[10]),y(o,"input",t[5]),y(o,"keydown",t[5]),y(o,"blur",t[5]),y(a,"click",t[6])],l=!0)},p(e,[t]){1&t&&v(o,"name",e[0]),1&t&&v(o,"id",e[0]),8&t&&w(o.value)!==e[3]&&x(o,e[3]),2&t&&$(s,e[1]),e[2]?m?m.p(e,t):(m=Ce(e),m.c(),m.m(n,null)):m&&(m.d(1),m=null)},i:e,o:e,d(e){e&&f(n),m&&m.d(),l=!1,r(g)}}}const Le=["PX","REM"],Ie=[...Le,"%"],Fe=[...Le,"VW","%"],Be=e=>Math.round(1e3*e)/1e3;function ze(e,t,n){let r,o,{value:i}=t,{name:a}=t,{breakpointWidth:s}=t,c="PX",l=!1,u=!1;const d=S(),f=()=>{n(2,l=!1)},g=e=>{n(1,c=e)};return e.$$set=e=>{"value"in e&&n(8,i=e.value),"name"in e&&n(0,a=e.name),"breakpointWidth"in e&&n(9,s=e.breakpointWidth)},e.$$.update=()=>{512&e.$$.dirty&&n(4,r="number"!=typeof s?Le:s?Fe:Ie),770&e.$$.dirty&&n(3,o=((e=0,t,n)=>{let r=e;const o=e/16;return"REM"===t&&(r=o),"%"===t&&(r=100*o),"VW"===t&&n&&(r=e/(n/100)),Be(r)})(i,c,s)),4&e.$$.dirty&&l&&document.addEventListener("click",f,{once:!0})},[a,c,l,o,r,async e=>{if("keydown"===e.type&&"key"in e)if("ArrowDown"===e.key||"ArrowUp"===e.key)u=!0;else if("Enter"!==e.key)return;if("input"===e.type){if(!u)return;u=!1}n(8,i=((e,t,n)=>{let r=e;const o=16*e;return"REM"===t&&(r=o),"%"===t&&(r=o/100),"VW"===t&&n&&(r=e*(n/100)),Be(r)})(o||0,c,s)),d("enter",i)},()=>{l||window.setTimeout((()=>n(2,l=!0)))},g,i,s,function(){o=w(this.value),n(3,o),n(8,i),n(1,c),n(9,s)},e=>g(e)]}class De extends Q{constructor(e){super(),Y(this,e,ze,je,i,{value:8,name:0,breakpointWidth:9})}}function Pe(t){let n,r,o,i,a;return r=new Te({props:{type:"remove"}}),{c(){n=p("div"),X(r.$$.fragment),v(n,"class","fs-fdg_breakpoint-remove")},m(e,s){var c;d(e,n,s),q(r,n,null),o=!0,i||(a=y(n,"click",(c=t[0],function(e){return e.stopPropagation(),c.call(this,e)})),i=!0)},p:e,i(e){o||(G(r.$$.fragment,e),o=!0)},o(e){V(r.$$.fragment,e),o=!1},d(e){e&&f(n),J(r),i=!1,a()}}}function He(e,t,n){let{index:r}=t;return e.$$set=e=>{"index"in e&&n(1,r=e.index)},[()=>{fe.removeBreakpoint(r)},r]}class Ue extends Q{constructor(e){super(),Y(this,e,He,Pe,i,{index:1})}}function Ze(e){let t,n;return t=new Ue({props:{index:e[0]}}),{c(){X(t.$$.fragment)},m(e,r){q(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.index=e[0]),t.$set(r)},i(e){n||(G(t.$$.fragment,e),n=!0)},o(e){V(t.$$.fragment,e),n=!1},d(e){J(t,e)}}}function We(e){let t,n,r,o;n=new De({props:{name:e[2]?"breakpoint-last":`breakpoint-${e[0]}`,value:e[1]}}),n.$on("enter",e[4]);let i=e[3].length>1&&Ze(e);return{c(){t=p("div"),X(n.$$.fragment),r=b(),i&&i.c(),v(t,"class","fs-fdg_breakpoint-control")},m(e,a){d(e,t,a),q(n,t,null),u(t,r),i&&i.m(t,null),o=!0},p(e,[r]){const o={};5&r&&(o.name=e[2]?"breakpoint-last":`breakpoint-${e[0]}`),2&r&&(o.value=e[1]),n.$set(o),e[3].length>1?i?(i.p(e,r),8&r&&G(i,1)):(i=Ze(e),i.c(),G(i,1),i.m(t,null)):i&&(Z(),V(i,1,1,(()=>{i=null})),W())},i(e){o||(G(n.$$.fragment,e),G(i),o=!0)},o(e){V(n.$$.fragment,e),V(i),o=!1},d(e){e&&f(t),J(n),i&&i.d()}}}function Ge(e,t,n){let r,o;c(e,fe,(e=>n(3,o=e)));let{index:i}=t,{breakpointFrom:a}=t;return e.$$set=e=>{"index"in e&&n(0,i=e.index),"breakpointFrom"in e&&n(1,a=e.breakpointFrom)},e.$$.update=()=>{1&e.$$.dirty&&n(2,r="number"!=typeof i)},[i,a,r,o,({detail:e})=>{r?ge.updateValue(e):fe.updateBreakpoint(i,e)}]}class Ve extends Q{constructor(e){super(),Y(this,e,Ge,We,i,{index:0,breakpointFrom:1})}}function Ke(t){let n,r,o;return{c(){n=p("div"),r=m("svg"),o=m("line"),v(o,"x1","0"),v(o,"y1",t[0]),v(o,"x2","100"),v(o,"y2",t[1]),v(o,"stroke","currentColor"),v(r,"height","100%"),v(r,"viewBox","0 0 100 100"),v(r,"fill","none"),v(r,"preserveAspectRatio","none"),v(r,"xmlns","http://www.w3.org/2000/svg"),v(n,"class","fs-fdg_breakpoint-graph")},m(e,t){d(e,n,t),u(n,r),u(r,o)},p(e,[t]){1&t&&v(o,"y1",e[0]),2&t&&v(o,"y2",e[1])},i:e,o:e,d(e){e&&f(n)}}}function Xe(e,t,n){let{y1:r}=t,{y2:o}=t;return e.$$set=e=>{"y1"in e&&n(0,r=e.y1),"y2"in e&&n(1,o=e.y2)},[r,o]}class qe extends Q{constructor(e){super(),Y(this,e,Xe,Ke,i,{y1:0,y2:1})}}const Je=e=>e instanceof MouseEvent?e.clientY:e.touches[0].clientY;function Ye(e){let t,n,o,i,a,s,c,l,g,m;return a=new De({props:{name:e[1]+"-"+e[0],value:e[3],breakpointWidth:e[4]}}),a.$on("enter",e[6]),{c(){t=p("div"),n=p("div"),o=b(),i=p("div"),X(a.$$.fragment),v(n,"class","fs-fdg_breakpoint-dot"),v(i,"class","fs-fdg_breakpoint-font-size"),v(i,"style",s=("fontFrom"===e[1]?"left":"right")+": 0%;"),v(t,"class","fs-fdg_breakpoint-handle"),v(t,"style",c=("fontFrom"===e[1]?"left":"right")+": 0%; top: "+e[2]+"%; transform: translate("+("fontFrom"===e[1]?"-0.375rem":"0.375rem")+", -0.375rem);")},m(r,s){d(r,t,s),u(t,n),u(t,o),u(t,i),q(a,i,null),l=!0,g||(m=[y(t,"mousedown",e[5]),y(t,"touchstart",e[5],{passive:!0})],g=!0)},p(e,[n]){const r={};3&n&&(r.name=e[1]+"-"+e[0]),8&n&&(r.value=e[3]),16&n&&(r.breakpointWidth=e[4]),a.$set(r),(!l||2&n&&s!==(s=("fontFrom"===e[1]?"left":"right")+": 0%;"))&&v(i,"style",s),(!l||6&n&&c!==(c=("fontFrom"===e[1]?"left":"right")+": 0%; top: "+e[2]+"%; transform: translate("+("fontFrom"===e[1]?"-0.375rem":"0.375rem")+", -0.375rem);"))&&v(t,"style",c)},i(e){l||(G(a.$$.fragment,e),l=!0)},o(e){V(a.$$.fragment,e),l=!1},d(e){e&&f(t),J(a),g=!1,r(m)}}}function Qe(e,t,n){let r,o;c(e,xe,(e=>n(10,r=e))),c(e,fe,(e=>n(11,o=e)));let i,a,{index:s}=t,{font:l}=t,{top:u}=t,{wrapperHeight:d}=t,{value:f}=t,{breakpointWidth:g}=t;const p=()=>{document.removeEventListener("mousemove",m),document.removeEventListener("touchmove",m),document.removeEventListener("mouseup",p),document.removeEventListener("touchend",p),a=void 0},m=e=>{e instanceof MouseEvent&&e.preventDefault();const t=Je(e),n=(t-i)/d;i=t,a-=r*n,fe.updateFont(s,l,a,1)};return e.$$set=e=>{"index"in e&&n(0,s=e.index),"font"in e&&n(1,l=e.font),"top"in e&&n(2,u=e.top),"wrapperHeight"in e&&n(7,d=e.wrapperHeight),"value"in e&&n(3,f=e.value),"breakpointWidth"in e&&n(4,g=e.breakpointWidth)},[s,l,u,f,g,e=>{const t=Je(e);i=t,a=o[s][l],document.addEventListener("mousemove",m),document.addEventListener("mouseup",p),document.addEventListener("touchend",p),document.addEventListener("touchmove",m,{passive:!0})},({detail:e})=>{fe.updateFont(s,l,e)},d]}class et extends Q{constructor(e){super(),Y(this,e,Qe,Ye,i,{index:0,font:1,top:2,wrapperHeight:7,value:3,breakpointWidth:4})}}function tt(t){let n,r;return{c(){n=m("svg"),r=m("path"),v(r,"d","M7.4 12H5V9.6H7.4V12ZM7.4 7.2H5V0H7.4V7.2Z"),v(n,"viewBox","0 0 12 12"),v(n,"fill","currentColor"),v(n,"xmlns","http://www.w3.org/2000/svg")},m(e,t){d(e,n,t),u(n,r)},p:e,i:e,o:e,d(e){e&&f(n)}}}class nt extends Q{constructor(e){super(),Y(this,e,null,tt,i,{})}}function rt(t){let n,r,o,i,a,s;return o=new nt({}),{c(){n=p("div"),r=p("div"),X(o.$$.fragment),i=b(),a=p("div"),a.textContent="Exceeding recommended values.",v(r,"class","fs-fdg_breakpoint-button is-warning"),v(a,"class","fs-fdg_breakpoint-warning-text"),v(n,"class","fs-fdg_breakpoint-warning")},m(e,t){d(e,n,t),u(n,r),q(o,r,null),u(n,i),u(n,a),s=!0},p:e,i(e){s||(G(o.$$.fragment,e),s=!0)},o(e){V(o.$$.fragment,e),s=!1},d(e){e&&f(n),J(o)}}}class ot extends Q{constructor(e){super(),Y(this,e,null,rt,i,{})}}function it(e){let t,n;return t=new Ve({props:{index:e[0],breakpointFrom:e[3]}}),{c(){X(t.$$.fragment)},m(e,r){q(t,e,r),n=!0},p(e,n){const r={};1&n&&(r.index=e[0]),8&n&&(r.breakpointFrom=e[3]),t.$set(r)},i(e){n||(G(t.$$.fragment,e),n=!0)},o(e){V(t.$$.fragment,e),n=!1},d(e){J(t,e)}}}function at(e){let t,n,r,o,i,a;return t=new Oe({props:{index:e[0]}}),r=new et({props:{index:e[0],wrapperHeight:e[7],top:e[9],font:"fontFrom",value:e[1],breakpointWidth:e[3]}}),i=new et({props:{index:e[0],wrapperHeight:e[7],top:e[8],font:"fontTo",value:e[2],breakpointWidth:e[4]}}),{c(){X(t.$$.fragment),n=b(),X(r.$$.fragment),o=b(),X(i.$$.fragment)},m(e,s){q(t,e,s),d(e,n,s),q(r,e,s),d(e,o,s),q(i,e,s),a=!0},p(e,n){const o={};1&n&&(o.index=e[0]),t.$set(o);const a={};1&n&&(a.index=e[0]),128&n&&(a.wrapperHeight=e[7]),512&n&&(a.top=e[9]),2&n&&(a.value=e[1]),8&n&&(a.breakpointWidth=e[3]),r.$set(a);const s={};1&n&&(s.index=e[0]),128&n&&(s.wrapperHeight=e[7]),256&n&&(s.top=e[8]),4&n&&(s.value=e[2]),16&n&&(s.breakpointWidth=e[4]),i.$set(s)},i(e){a||(G(t.$$.fragment,e),G(r.$$.fragment,e),G(i.$$.fragment,e),a=!0)},o(e){V(t.$$.fragment,e),V(r.$$.fragment,e),V(i.$$.fragment,e),a=!1},d(e){J(t,e),e&&f(n),J(r,e),e&&f(o),J(i,e)}}}function st(e){let t,n;return t=new ot({}),{c(){X(t.$$.fragment)},m(e,r){q(t,e,r),n=!0},i(e){n||(G(t.$$.fragment,e),n=!0)},o(e){V(t.$$.fragment,e),n=!1},d(e){J(t,e)}}}function ct(e){let t,n,r,o,i,a,s,c;n=new qe({props:{y1:e[9],y2:e[8]}});let l=(e[0]>0||e[10])&&it(e),g=!e[10]&&at(e),m=e[5]&&st();return{c(){t=p("div"),X(n.$$.fragment),r=b(),l&&l.c(),o=b(),g&&g.c(),i=b(),m&&m.c(),v(t,"class","fs-fdg_breakpoint"),k(t,"is-last",e[10])},m(f,p){d(f,t,p),q(n,t,null),u(t,r),l&&l.m(t,null),u(t,o),g&&g.m(t,null),u(t,i),m&&m.m(t,null),e[13](t),a=!0,s||(c=y(window,"resize",e[11]),s=!0)},p(e,[r]){const a={};512&r&&(a.y1=e[9]),256&r&&(a.y2=e[8]),n.$set(a),e[0]>0||e[10]?l?(l.p(e,r),1025&r&&G(l,1)):(l=it(e),l.c(),G(l,1),l.m(t,o)):l&&(Z(),V(l,1,1,(()=>{l=null})),W()),e[10]?g&&(Z(),V(g,1,1,(()=>{g=null})),W()):g?(g.p(e,r),1024&r&&G(g,1)):(g=at(e),g.c(),G(g,1),g.m(t,i)),e[5]?m?32&r&&G(m,1):(m=st(),m.c(),G(m,1),m.m(t,null)):m&&(Z(),V(m,1,1,(()=>{m=null})),W()),1024&r&&k(t,"is-last",e[10])},i(e){a||(G(n.$$.fragment,e),G(l),G(g),G(m),a=!0)},o(e){V(n.$$.fragment,e),V(l),V(g),V(m),a=!1},d(r){r&&f(t),J(n),l&&l.d(),g&&g.d(),m&&m.d(),e[13](null),s=!1,c()}}}function lt(e,t,n){let r,o,i,a;c(e,xe,(e=>n(12,a=e)));let s,l,{index:u}=t,{fontFrom:d}=t,{fontTo:f}=t,{breakpointFrom:g}=t,{breakpointTo:p}=t,{warning:m}=t;const h=()=>{n(7,l=s.getBoundingClientRect().height)};return T(h),e.$$set=e=>{"index"in e&&n(0,u=e.index),"fontFrom"in e&&n(1,d=e.fontFrom),"fontTo"in e&&n(2,f=e.fontTo),"breakpointFrom"in e&&n(3,g=e.breakpointFrom),"breakpointTo"in e&&n(4,p=e.breakpointTo),"warning"in e&&n(5,m=e.warning)},e.$$.update=()=>{1&e.$$.dirty&&n(10,r="number"!=typeof u),4098&e.$$.dirty&&n(9,o=100*(a-d)/a),4100&e.$$.dirty&&n(8,i=100*(a-f)/a)},[u,d,f,g,p,m,s,l,i,o,r,h,a,function(e){O[e?"unshift":"push"]((()=>{s=e,n(6,s)}))}]}class ut extends Q{constructor(e){super(),Y(this,e,lt,ct,i,{index:0,fontFrom:1,fontTo:2,breakpointFrom:3,breakpointTo:4,warning:5})}}function dt(e,t,n){const r=e.slice();return r[2]=t[n].breakpointFrom,r[3]=t[n].breakpointTo,r[4]=t[n].fontFrom,r[5]=t[n].fontTo,r[6]=t[n].warning,r[8]=n,r}function ft(e){let t,n,r,o=e[8]>0&&function(e){let t;return{c(){t=p("div"),v(t,"class","fs-fdg_breakpoint-gap")},m(e,n){d(e,t,n)},d(e){e&&f(t)}}}();return n=new ut({props:{index:e[8],fontFrom:e[4],fontTo:e[5],breakpointFrom:e[2],breakpointTo:e[3],warning:e[6]}}),{c(){o&&o.c(),t=b(),X(n.$$.fragment)},m(e,i){o&&o.m(e,i),d(e,t,i),q(n,e,i),r=!0},p(e,t){const r={};1&t&&(r.fontFrom=e[4]),1&t&&(r.fontTo=e[5]),1&t&&(r.breakpointFrom=e[2]),1&t&&(r.breakpointTo=e[3]),1&t&&(r.warning=e[6]),n.$set(r)},i(e){r||(G(n.$$.fragment,e),r=!0)},o(e){V(n.$$.fragment,e),r=!1},d(e){o&&o.d(e),e&&f(t),J(n,e)}}}function gt(e){let t,n,r,o,i,a,s,c,l,m=e[0],h=[];for(let t=0;t<m.length;t+=1)h[t]=ft(dt(e,m,t));const y=e=>V(h[e],1,1,(()=>{h[e]=null}));return o=new ut({props:{fontFrom:e[1].fontFrom,fontTo:e[1].fontTo,breakpointFrom:e[1].breakpointFrom,warning:e[1].warning}}),{c(){t=p("div"),n=p("div");for(let e=0;e<h.length;e+=1)h[e].c();r=b(),X(o.$$.fragment),i=b(),a=p("div"),a.textContent="Root font size",s=b(),c=p("div"),c.textContent="Screen width",v(a,"class","fs-fdg_axis-label is-y"),v(c,"class","fs-fdg_axis-label is-x"),v(n,"class","fs-fdg_chart"),v(t,"class","fs-fdg_chart-wrapper")},m(e,f){d(e,t,f),u(t,n);for(let e=0;e<h.length;e+=1)h[e].m(n,null);u(n,r),q(o,n,null),u(n,i),u(n,a),u(n,s),u(n,c),l=!0},p(e,[t]){if(1&t){let o;for(m=e[0],o=0;o<m.length;o+=1){const i=dt(e,m,o);h[o]?(h[o].p(i,t),G(h[o],1)):(h[o]=ft(i),h[o].c(),G(h[o],1),h[o].m(n,r))}for(Z(),o=m.length;o<h.length;o+=1)y(o);W()}const i={};2&t&&(i.fontFrom=e[1].fontFrom),2&t&&(i.fontTo=e[1].fontTo),2&t&&(i.breakpointFrom=e[1].breakpointFrom),2&t&&(i.warning=e[1].warning),o.$set(i)},i(e){if(!l){for(let e=0;e<m.length;e+=1)G(h[e]);G(o.$$.fragment,e),l=!0}},o(e){h=h.filter(Boolean);for(let e=0;e<h.length;e+=1)V(h[e]);V(o.$$.fragment,e),l=!1},d(e){e&&f(t),g(h,e),J(o)}}}function pt(e,t,n){let r,o;return c(e,ye,(e=>n(0,r=e))),c(e,ve,(e=>n(1,o=e))),[r,o]}class mt extends Q{constructor(e){super(),Y(this,e,pt,gt,i,{})}}const ht=ue(we,(e=>e.some((({warning:e})=>e))));"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function bt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var yt={exports:{}};function vt(e){return e instanceof Map?e.clear=e.delete=e.set=function(){throw new Error("map is read-only")}:e instanceof Set&&(e.add=e.clear=e.delete=function(){throw new Error("set is read-only")}),Object.freeze(e),Object.getOwnPropertyNames(e).forEach((function(t){var n=e[t];"object"!=typeof n||Object.isFrozen(n)||vt(n)})),e}yt.exports=vt,yt.exports.default=vt;var wt=yt.exports;class $t{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function xt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function kt(e,...t){const n=Object.create(null);for(const t in e)n[t]=e[t];return t.forEach((function(e){for(const t in e)n[t]=e[t]})),n}const Et=e=>!!e.kind;class _t{constructor(e,t){this.buffer="",this.classPrefix=t.classPrefix,e.walk(this)}addText(e){this.buffer+=xt(e)}openNode(e){if(!Et(e))return;let t=e.kind;t=e.sublanguage?`language-${t}`:((e,{prefix:t})=>{if(e.includes(".")){const n=e.split(".");return[`${t}${n.shift()}`,...n.map(((e,t)=>`${e}${"_".repeat(t+1)}`))].join(" ")}return`${t}${e}`})(t,{prefix:this.classPrefix}),this.span(t)}closeNode(e){Et(e)&&(this.buffer+="</span>")}value(){return this.buffer}span(e){this.buffer+=`<span class="${e}">`}}class At{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const t={kind:e,children:[]};this.add(t),this.stack.push(t)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,t){return"string"==typeof t?e.addText(t):t.children&&(e.openNode(t),t.children.forEach((t=>this._walk(e,t))),e.closeNode(t)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every((e=>"string"==typeof e))?e.children=[e.children.join("")]:e.children.forEach((e=>{At._collapse(e)})))}}class Tt extends At{constructor(e){super(),this.options=e}addKeyword(e,t){""!==e&&(this.openNode(t),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,t){const n=e.root;n.kind=t,n.sublanguage=!0,this.add(n)}toHTML(){return new _t(this,this.options).value()}finalize(){return!0}}function St(e){return e?"string"==typeof e?e:e.source:null}function Nt(e){return Ct("(?=",e,")")}function Ot(e){return Ct("(?:",e,")*")}function Mt(e){return Ct("(?:",e,")?")}function Ct(...e){return e.map((e=>St(e))).join("")}function Rt(...e){const t=function(e){const t=e[e.length-1];return"object"==typeof t&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}(e);return"("+(t.capture?"":"?:")+e.map((e=>St(e))).join("|")+")"}function jt(e){return new RegExp(e.toString()+"|").exec("").length-1}const Lt=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function It(e,{joinWith:t}){let n=0;return e.map((e=>{n+=1;const t=n;let r=St(e),o="";for(;r.length>0;){const e=Lt.exec(r);if(!e){o+=r;break}o+=r.substring(0,e.index),r=r.substring(e.index+e[0].length),"\\"===e[0][0]&&e[1]?o+="\\"+String(Number(e[1])+t):(o+=e[0],"("===e[0]&&n++)}return o})).map((e=>`(${e})`)).join(t)}const Ft="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",Bt={begin:"\\\\[\\s\\S]",relevance:0},zt={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[Bt]},Dt={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[Bt]},Pt=function(e,t,n={}){const r=kt({scope:"comment",begin:e,end:t,contains:[]},n);r.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const o=Rt("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return r.contains.push({begin:Ct(/[ ]+/,"(",o,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),r},Ht=Pt("//","$"),Ut=Pt("/\\*","\\*/"),Zt=Pt("#","$"),Wt={scope:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},Gt={scope:"number",begin:Ft,relevance:0},Vt={scope:"number",begin:"\\b(0b[01]+)",relevance:0},Kt={begin:/(?=\/[^/\n]*\/)/,contains:[{scope:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[Bt,{begin:/\[/,end:/\]/,relevance:0,contains:[Bt]}]}]},Xt={scope:"title",begin:"[a-zA-Z]\\w*",relevance:0},qt={scope:"title",begin:"[a-zA-Z_]\\w*",relevance:0},Jt={begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0};var Yt=Object.freeze({__proto__:null,MATCH_NOTHING_RE:/\b\B/,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:Ft,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const t=/^#![ ]*\//;return e.binary&&(e.begin=Ct(t,/.*\b/,e.binary,/\b.*/)),kt({scope:"meta",begin:t,end:/$/,relevance:0,"on:begin":(e,t)=>{0!==e.index&&t.ignoreMatch()}},e)},BACKSLASH_ESCAPE:Bt,APOS_STRING_MODE:zt,QUOTE_STRING_MODE:Dt,PHRASAL_WORDS_MODE:{begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},COMMENT:Pt,C_LINE_COMMENT_MODE:Ht,C_BLOCK_COMMENT_MODE:Ut,HASH_COMMENT_MODE:Zt,NUMBER_MODE:Wt,C_NUMBER_MODE:Gt,BINARY_NUMBER_MODE:Vt,REGEXP_MODE:Kt,TITLE_MODE:Xt,UNDERSCORE_TITLE_MODE:qt,METHOD_GUARD:Jt,END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,t)=>{t.data._beginMatch=e[1]},"on:end":(e,t)=>{t.data._beginMatch!==e[1]&&t.ignoreMatch()}})}});function Qt(e,t){"."===e.input[e.index-1]&&t.ignoreMatch()}function en(e,t){void 0!==e.className&&(e.scope=e.className,delete e.className)}function tn(e,t){t&&e.beginKeywords&&(e.begin="\\b("+e.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",e.__beforeBegin=Qt,e.keywords=e.keywords||e.beginKeywords,delete e.beginKeywords,void 0===e.relevance&&(e.relevance=0))}function nn(e,t){Array.isArray(e.illegal)&&(e.illegal=Rt(...e.illegal))}function rn(e,t){if(e.match){if(e.begin||e.end)throw new Error("begin & end are not supported with match");e.begin=e.match,delete e.match}}function on(e,t){void 0===e.relevance&&(e.relevance=1)}const an=(e,t)=>{if(!e.beforeMatch)return;if(e.starts)throw new Error("beforeMatch cannot be used with starts");const n=Object.assign({},e);Object.keys(e).forEach((t=>{delete e[t]})),e.keywords=n.keywords,e.begin=Ct(n.beforeMatch,Nt(n.begin)),e.starts={relevance:0,contains:[Object.assign(n,{endsParent:!0})]},e.relevance=0,delete n.beforeMatch},sn=["of","and","for","in","not","or","if","then","parent","list","value"];function cn(e,t,n="keyword"){const r=Object.create(null);return"string"==typeof e?o(n,e.split(" ")):Array.isArray(e)?o(n,e):Object.keys(e).forEach((function(n){Object.assign(r,cn(e[n],t,n))})),r;function o(e,n){t&&(n=n.map((e=>e.toLowerCase()))),n.forEach((function(t){const n=t.split("|");r[n[0]]=[e,ln(n[0],n[1])]}))}}function ln(e,t){return t?Number(t):function(e){return sn.includes(e.toLowerCase())}(e)?0:1}const un={},dn=e=>{console.error(e)},fn=(e,...t)=>{console.log(`WARN: ${e}`,...t)},gn=(e,t)=>{un[`${e}/${t}`]||(console.log(`Deprecated as of ${e}. ${t}`),un[`${e}/${t}`]=!0)},pn=new Error;function mn(e,t,{key:n}){let r=0;const o=e[n],i={},a={};for(let e=1;e<=t.length;e++)a[e+r]=o[e],i[e+r]=!0,r+=jt(t[e-1]);e[n]=a,e[n]._emit=i,e[n]._multi=!0}function hn(e){!function(e){e.scope&&"object"==typeof e.scope&&null!==e.scope&&(e.beginScope=e.scope,delete e.scope)}(e),"string"==typeof e.beginScope&&(e.beginScope={_wrap:e.beginScope}),"string"==typeof e.endScope&&(e.endScope={_wrap:e.endScope}),function(e){if(Array.isArray(e.begin)){if(e.skip||e.excludeBegin||e.returnBegin)throw dn("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),pn;if("object"!=typeof e.beginScope||null===e.beginScope)throw dn("beginScope must be object"),pn;mn(e,e.begin,{key:"beginScope"}),e.begin=It(e.begin,{joinWith:""})}}(e),function(e){if(Array.isArray(e.end)){if(e.skip||e.excludeEnd||e.returnEnd)throw dn("skip, excludeEnd, returnEnd not compatible with endScope: {}"),pn;if("object"!=typeof e.endScope||null===e.endScope)throw dn("endScope must be object"),pn;mn(e,e.end,{key:"endScope"}),e.end=It(e.end,{joinWith:""})}}(e)}function bn(e){function t(t,n){return new RegExp(St(t),"m"+(e.case_insensitive?"i":"")+(e.unicodeRegex?"u":"")+(n?"g":""))}class n{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,t){t.position=this.position++,this.matchIndexes[this.matchAt]=t,this.regexes.push([t,e]),this.matchAt+=jt(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map((e=>e[1]));this.matcherRe=t(It(e,{joinWith:"|"}),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const t=this.matcherRe.exec(e);if(!t)return null;const n=t.findIndex(((e,t)=>t>0&&void 0!==e)),r=this.matchIndexes[n];return t.splice(0,n),Object.assign(t,r)}}class r{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const t=new n;return this.rules.slice(e).forEach((([e,n])=>t.addRule(e,n))),t.compile(),this.multiRegexes[e]=t,t}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,t){this.rules.push([e,t]),"begin"===t.type&&this.count++}exec(e){const t=this.getMatcher(this.regexIndex);t.lastIndex=this.lastIndex;let n=t.exec(e);if(this.resumingScanAtSamePosition())if(n&&n.index===this.lastIndex);else{const t=this.getMatcher(0);t.lastIndex=this.lastIndex+1,n=t.exec(e)}return n&&(this.regexIndex+=n.position+1,this.regexIndex===this.count&&this.considerAll()),n}}if(e.compilerExtensions||(e.compilerExtensions=[]),e.contains&&e.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return e.classNameAliases=kt(e.classNameAliases||{}),function n(o,i){const a=o;if(o.isCompiled)return a;[en,rn,hn,an].forEach((e=>e(o,i))),e.compilerExtensions.forEach((e=>e(o,i))),o.__beforeBegin=null,[tn,nn,on].forEach((e=>e(o,i))),o.isCompiled=!0;let s=null;return"object"==typeof o.keywords&&o.keywords.$pattern&&(o.keywords=Object.assign({},o.keywords),s=o.keywords.$pattern,delete o.keywords.$pattern),s=s||/\w+/,o.keywords&&(o.keywords=cn(o.keywords,e.case_insensitive)),a.keywordPatternRe=t(s,!0),i&&(o.begin||(o.begin=/\B|\b/),a.beginRe=t(a.begin),o.end||o.endsWithParent||(o.end=/\B|\b/),o.end&&(a.endRe=t(a.end)),a.terminatorEnd=St(a.end)||"",o.endsWithParent&&i.terminatorEnd&&(a.terminatorEnd+=(o.end?"|":"")+i.terminatorEnd)),o.illegal&&(a.illegalRe=t(o.illegal)),o.contains||(o.contains=[]),o.contains=[].concat(...o.contains.map((function(e){return function(e){e.variants&&!e.cachedVariants&&(e.cachedVariants=e.variants.map((function(t){return kt(e,{variants:null},t)})));if(e.cachedVariants)return e.cachedVariants;if(yn(e))return kt(e,{starts:e.starts?kt(e.starts):null});if(Object.isFrozen(e))return kt(e);return e}("self"===e?o:e)}))),o.contains.forEach((function(e){n(e,a)})),o.starts&&n(o.starts,i),a.matcher=function(e){const t=new r;return e.contains.forEach((e=>t.addRule(e.begin,{rule:e,type:"begin"}))),e.terminatorEnd&&t.addRule(e.terminatorEnd,{type:"end"}),e.illegal&&t.addRule(e.illegal,{type:"illegal"}),t}(a),a}(e)}function yn(e){return!!e&&(e.endsWithParent||yn(e.starts))}class vn extends Error{constructor(e,t){super(e),this.name="HTMLInjectionError",this.html=t}}const wn=xt,$n=kt,xn=Symbol("nomatch");var kn=function(e){const t=Object.create(null),n=Object.create(null),r=[];let o=!0;const i="Could not find the language '{}', did you forget to load/include a language module?",a={disableAutodetect:!0,name:"Plain text",contains:[]};let s={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:Tt};function c(e){return s.noHighlightRe.test(e)}function l(e,t,n){let r="",o="";"object"==typeof t?(r=e,n=t.ignoreIllegals,o=t.language):(gn("10.7.0","highlight(lang, code, ...args) has been deprecated."),gn("10.7.0","Please use highlight(code, options) instead.\nhttps://github.com/highlightjs/highlight.js/issues/2277"),o=e,r=t),void 0===n&&(n=!0);const i={code:r,language:o};y("before:highlight",i);const a=i.result?i.result:u(i.language,i.code,n);return a.code=i.code,y("after:highlight",a),a}function u(e,n,r,a){const c=Object.create(null);function l(){if(!E.keywords)return void A.addText(T);let e=0;E.keywordPatternRe.lastIndex=0;let t=E.keywordPatternRe.exec(T),n="";for(;t;){n+=T.substring(e,t.index);const o=$.case_insensitive?t[0].toLowerCase():t[0],i=(r=o,E.keywords[r]);if(i){const[e,r]=i;if(A.addText(n),n="",c[o]=(c[o]||0)+1,c[o]<=7&&(S+=r),e.startsWith("_"))n+=t[0];else{const n=$.classNameAliases[e]||e;A.addKeyword(t[0],n)}}else n+=t[0];e=E.keywordPatternRe.lastIndex,t=E.keywordPatternRe.exec(T)}var r;n+=T.substr(e),A.addText(n)}function f(){null!=E.subLanguage?function(){if(""===T)return;let e=null;if("string"==typeof E.subLanguage){if(!t[E.subLanguage])return void A.addText(T);e=u(E.subLanguage,T,!0,_[E.subLanguage]),_[E.subLanguage]=e._top}else e=d(T,E.subLanguage.length?E.subLanguage:null);E.relevance>0&&(S+=e.relevance),A.addSublanguage(e._emitter,e.language)}():l(),T=""}function g(e,t){let n=1;for(;void 0!==t[n];){if(!e._emit[n]){n++;continue}const r=$.classNameAliases[e[n]]||e[n],o=t[n];r?A.addKeyword(o,r):(T=o,l(),T=""),n++}}function p(e,t){return e.scope&&"string"==typeof e.scope&&A.openNode($.classNameAliases[e.scope]||e.scope),e.beginScope&&(e.beginScope._wrap?(A.addKeyword(T,$.classNameAliases[e.beginScope._wrap]||e.beginScope._wrap),T=""):e.beginScope._multi&&(g(e.beginScope,t),T="")),E=Object.create(e,{parent:{value:E}}),E}function h(e,t,n){let r=function(e,t){const n=e&&e.exec(t);return n&&0===n.index}(e.endRe,n);if(r){if(e["on:end"]){const n=new $t(e);e["on:end"](t,n),n.isMatchIgnored&&(r=!1)}if(r){for(;e.endsParent&&e.parent;)e=e.parent;return e}}if(e.endsWithParent)return h(e.parent,t,n)}function b(e){return 0===E.matcher.regexIndex?(T+=e[0],1):(M=!0,0)}function y(e){const t=e[0],r=n.substr(e.index),o=h(E,e,r);if(!o)return xn;const i=E;E.endScope&&E.endScope._wrap?(f(),A.addKeyword(t,E.endScope._wrap)):E.endScope&&E.endScope._multi?(f(),g(E.endScope,e)):i.skip?T+=t:(i.returnEnd||i.excludeEnd||(T+=t),f(),i.excludeEnd&&(T=t));do{E.scope&&A.closeNode(),E.skip||E.subLanguage||(S+=E.relevance),E=E.parent}while(E!==o.parent);return o.starts&&p(o.starts,e),i.returnEnd?0:t.length}let v={};function w(t,i){const a=i&&i[0];if(T+=t,null==a)return f(),0;if("begin"===v.type&&"end"===i.type&&v.index===i.index&&""===a){if(T+=n.slice(i.index,i.index+1),!o){const t=new Error(`0 width match regex (${e})`);throw t.languageName=e,t.badRule=v.rule,t}return 1}if(v=i,"begin"===i.type)return function(e){const t=e[0],n=e.rule,r=new $t(n),o=[n.__beforeBegin,n["on:begin"]];for(const n of o)if(n&&(n(e,r),r.isMatchIgnored))return b(t);return n.skip?T+=t:(n.excludeBegin&&(T+=t),f(),n.returnBegin||n.excludeBegin||(T=t)),p(n,e),n.returnBegin?0:t.length}(i);if("illegal"===i.type&&!r){const e=new Error('Illegal lexeme "'+a+'" for mode "'+(E.scope||"<unnamed>")+'"');throw e.mode=E,e}if("end"===i.type){const e=y(i);if(e!==xn)return e}if("illegal"===i.type&&""===a)return 1;if(O>1e5&&O>3*i.index){throw new Error("potential infinite loop, way more iterations than matches")}return T+=a,a.length}const $=m(e);if(!$)throw dn(i.replace("{}",e)),new Error('Unknown language: "'+e+'"');const x=bn($);let k="",E=a||x;const _={},A=new s.__emitter(s);!function(){const e=[];for(let t=E;t!==$;t=t.parent)t.scope&&e.unshift(t.scope);e.forEach((e=>A.openNode(e)))}();let T="",S=0,N=0,O=0,M=!1;try{for(E.matcher.considerAll();;){O++,M?M=!1:E.matcher.considerAll(),E.matcher.lastIndex=N;const e=E.matcher.exec(n);if(!e)break;const t=w(n.substring(N,e.index),e);N=e.index+t}return w(n.substr(N)),A.closeAllNodes(),A.finalize(),k=A.toHTML(),{language:e,value:k,relevance:S,illegal:!1,_emitter:A,_top:E}}catch(t){if(t.message&&t.message.includes("Illegal"))return{language:e,value:wn(n),illegal:!0,relevance:0,_illegalBy:{message:t.message,index:N,context:n.slice(N-100,N+100),mode:t.mode,resultSoFar:k},_emitter:A};if(o)return{language:e,value:wn(n),illegal:!1,relevance:0,errorRaised:t,_emitter:A,_top:E};throw t}}function d(e,n){n=n||s.languages||Object.keys(t);const r=function(e){const t={value:wn(e),illegal:!1,relevance:0,_top:a,_emitter:new s.__emitter(s)};return t._emitter.addText(e),t}(e),o=n.filter(m).filter(b).map((t=>u(t,e,!1)));o.unshift(r);const i=o.sort(((e,t)=>{if(e.relevance!==t.relevance)return t.relevance-e.relevance;if(e.language&&t.language){if(m(e.language).supersetOf===t.language)return 1;if(m(t.language).supersetOf===e.language)return-1}return 0})),[c,l]=i,d=c;return d.secondBest=l,d}function f(e){let t=null;const r=function(e){let t=e.className+" ";t+=e.parentNode?e.parentNode.className:"";const n=s.languageDetectRe.exec(t);if(n){const t=m(n[1]);return t||(fn(i.replace("{}",n[1])),fn("Falling back to no-highlight mode for this block.",e)),t?n[1]:"no-highlight"}return t.split(/\s+/).find((e=>c(e)||m(e)))}(e);if(c(r))return;if(y("before:highlightElement",{el:e,language:r}),e.children.length>0&&(s.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(e)),s.throwUnescapedHTML)){throw new vn("One of your code blocks includes unescaped HTML.",e.innerHTML)}t=e;const o=t.textContent,a=r?l(o,{language:r,ignoreIllegals:!0}):d(o);e.innerHTML=a.value,function(e,t,r){const o=t&&n[t]||r;e.classList.add("hljs"),e.classList.add(`language-${o}`)}(e,r,a.language),e.result={language:a.language,re:a.relevance,relevance:a.relevance},a.secondBest&&(e.secondBest={language:a.secondBest.language,relevance:a.secondBest.relevance}),y("after:highlightElement",{el:e,result:a,text:o})}let g=!1;function p(){if("loading"===document.readyState)return void(g=!0);document.querySelectorAll(s.cssSelector).forEach(f)}function m(e){return e=(e||"").toLowerCase(),t[e]||t[n[e]]}function h(e,{languageName:t}){"string"==typeof e&&(e=[e]),e.forEach((e=>{n[e.toLowerCase()]=t}))}function b(e){const t=m(e);return t&&!t.disableAutodetect}function y(e,t){const n=e;r.forEach((function(e){e[n]&&e[n](t)}))}"undefined"!=typeof window&&window.addEventListener&&window.addEventListener("DOMContentLoaded",(function(){g&&p()}),!1),Object.assign(e,{highlight:l,highlightAuto:d,highlightAll:p,highlightElement:f,highlightBlock:function(e){return gn("10.7.0","highlightBlock will be removed entirely in v12.0"),gn("10.7.0","Please use highlightElement now."),f(e)},configure:function(e){s=$n(s,e)},initHighlighting:()=>{p(),gn("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")},initHighlightingOnLoad:function(){p(),gn("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")},registerLanguage:function(n,r){let i=null;try{i=r(e)}catch(e){if(dn("Language definition for '{}' could not be registered.".replace("{}",n)),!o)throw e;dn(e),i=a}i.name||(i.name=n),t[n]=i,i.rawDefinition=r.bind(null,e),i.aliases&&h(i.aliases,{languageName:n})},unregisterLanguage:function(e){delete t[e];for(const t of Object.keys(n))n[t]===e&&delete n[t]},listLanguages:function(){return Object.keys(t)},getLanguage:m,registerAliases:h,autoDetection:b,inherit:$n,addPlugin:function(e){!function(e){e["before:highlightBlock"]&&!e["before:highlightElement"]&&(e["before:highlightElement"]=t=>{e["before:highlightBlock"](Object.assign({block:t.el},t))}),e["after:highlightBlock"]&&!e["after:highlightElement"]&&(e["after:highlightElement"]=t=>{e["after:highlightBlock"](Object.assign({block:t.el},t))})}(e),r.push(e)}}),e.debugMode=function(){o=!1},e.safeMode=function(){o=!0},e.versionString="11.4.0",e.regex={concat:Ct,lookahead:Nt,either:Rt,optional:Mt,anyNumberOfTimes:Ot};for(const e in Yt)"object"==typeof Yt[e]&&wt(Yt[e]);return Object.assign(e,Yt),e}({}),En=kn;kn.HighlightJS=kn,kn.default=kn;const _n=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","p","q","quote","samp","section","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],An=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"],Tn=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link"