@uniformdev/context-devtools 16.0.0 → 16.0.1-alpha.221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/esm/index.js +86 -509
  2. package/dist/index.js +75 -498
  3. package/package.json +20 -16
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import{jsx as e}from"@emotion/react";import*as y from"react";import{css as x}from"@emotion/react";import{createContext as mt,useContext as ut}from"react";var he=mt({settings:{},saveSettings:()=>null}),_=()=>ut(he),be=({children:t,settings:r,saveSettings:n})=>e(he.Provider,{value:{settings:r,saveSettings:n}},t);var gt=({route:t,children:r,className:n})=>{let{settings:o,saveSettings:i}=_();return e("a",{href:"",className:n,onClick:a=>{a.preventDefault(),i({...o,route:t})}},r)},H=gt;var ft=[{title:"Dimensions",href:"/dimensions",icon:`<svg
1
+ import{jsx as e}from"@emotion/react";import*as y from"react";import{css as L}from"@emotion/react";import{createContext as nt,useContext as it}from"react";var ge=nt({settings:{},saveSettings:()=>{}}),U=()=>it(ge),ve=({children:t,settings:r,saveSettings:n})=>e(ge.Provider,{value:{settings:r,saveSettings:n}},t);var st=({route:t,children:r,className:n})=>{let{settings:o,saveSettings:s}=U();return e("a",{href:"",className:n,onClick:a=>{a.preventDefault(),s({...o,route:t})}},r)},H=st;var at=[{title:"Dimensions",href:"/dimensions",icon:`<svg
2
2
  width="24"
3
3
  height="24"
4
4
  viewBox="0 0 24 24"
@@ -36,28 +36,28 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{css as x}fro
36
36
  </svg>`},{title:"Settings",href:"/settings",icon:`<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
37
37
  <path d="M19.1469 12.716C19.1986 12.2636 19.201 11.8069 19.1539 11.354L21.7429 9.474C21.8681 9.3822 21.9548 9.24723 21.9862 9.0952C22.0176 8.94316 21.9915 8.78489 21.9129 8.651L19.9939 5.399C19.9182 5.26986 19.7985 5.17231 19.6568 5.1242C19.515 5.07608 19.3606 5.08063 19.2219 5.137L16.3599 6.292C15.9237 5.9578 15.4502 5.67525 14.9489 5.45L14.5739 2.545C14.5547 2.39441 14.4813 2.25598 14.3673 2.15566C14.2534 2.05534 14.1068 1.99999 13.9549 2H10.0859C9.93402 1.99997 9.78728 2.05527 9.67317 2.15558C9.55906 2.25588 9.48539 2.39432 9.46595 2.545L9.09395 5.433C8.63957 5.63249 8.20723 5.87882 7.80395 6.168L5.00895 4.954C4.87173 4.89484 4.71787 4.88672 4.57519 4.9311C4.4325 4.97549 4.3104 5.06945 4.23095 5.196L2.22195 8.398C2.1396 8.52998 2.10934 8.68789 2.13707 8.84096C2.1648 8.99403 2.24854 9.1313 2.37195 9.226L4.86795 11.142C4.83172 11.4266 4.81302 11.7131 4.81195 12C4.81195 12.18 4.82095 12.362 4.83795 12.558L2.26495 14.375C2.13766 14.4647 2.04844 14.5987 2.01478 14.7508C1.98112 14.9028 2.00543 15.0619 2.08295 15.197L3.95695 18.474C4.11095 18.742 4.43695 18.857 4.72595 18.746L7.56095 17.644C8.00795 17.997 8.49195 18.294 9.00795 18.53L9.33795 21.396C9.37495 21.709 9.63795 21.946 9.95195 21.95L13.8169 22H13.8249C14.1349 22 14.3989 21.771 14.4439 21.463L14.8549 18.59C15.3703 18.3674 15.8579 18.0855 16.3079 17.75L19.1279 18.93C19.4129 19.05 19.7419 18.944 19.9029 18.679L21.8669 15.452C21.9477 15.319 21.976 15.1608 21.9464 15.0081C21.9168 14.8554 21.8315 14.7192 21.7069 14.626L19.1469 12.716ZM11.9999 15C10.3459 15 8.99995 13.655 8.99995 12C8.99995 10.346 10.3449 9 11.9999 9C13.6539 9 14.9999 10.345 14.9999 12C14.9999 13.654 13.6539 15 11.9999 15Z" fill="white"/>
38
38
  </svg>
39
- `}],vt=`<svg width="24" height="24" fill="white" viewBox="0 0 122.88 116.67" xmlns="http://www.w3.org/2000/svg">
39
+ `}],ct=`<svg width="24" height="24" fill="white" viewBox="0 0 122.88 116.67" xmlns="http://www.w3.org/2000/svg">
40
40
  <g>
41
41
  <path d="M84.55,116.66c2.49,0,4.53-1.99,4.53-4.41V88.08c1.55-13.03,7.27-9.16,14-5.13 c16.27,9.74,27.08-15.88,13.93-23.78c-10.32-6.2-14.79,4.46-22.35,3.36c-2.92-0.43-4.95-3.5-5.59-8.17V36.9 c0-2.43-2.04-4.41-4.53-4.41H63.73c-17.18-2.12-1.93-11.37-1.93-19.98C61.81,5.6,55.38,0,47.45,0c-7.92,0-15.19,5.6-15.19,12.51 c0,8.12,15.78,17.86-1.64,19.98H4.53C2.04,32.49,0,34.47,0,36.9v17.42c1.33,7.43,6.49,9.15,13.1,4.25 c2.23-1.66,5.99-3.59,8.71-3.59c7.09,0,12.85,6.25,12.85,13.96S28.91,84.6,21.81,84.6c-2.53,0-4.89-0.8-6.89-2.19 c0,0.59-12.4-10.85-14.92,3.15v26.71c0,2.43,2.04,4.41,4.53,4.41c13.97,0,27.92,0,41.88-0.01c0.55-2.55-1.24-5.47-2.92-8 c-13.22-19.93,38.21-21.92,24.99,0.62c-0.65,1.11-1.3,2.19-1.8,3.24c-0.63,1.31-1.05,2.91-0.96,4.14L84.55,116.66L84.55,116.66z"></path>
42
42
  </g>
43
- </svg>`,ye=({...t})=>{var o,i;let r=a=>{var p;let l="active";return!((p=t.settings)!=null&&p.route)&&a==="/dimensions"||t.settings.route===a?l:""},n=Boolean(typeof window!="undefined"&&((i=(o=window.chrome)==null?void 0:o.runtime)==null?void 0:i.id));return e("nav",{css:x`
43
+ </svg>`,fe=({...t})=>{var o,s;let r=a=>{var p;let l="active";return!((p=t.settings)!=null&&p.route)&&a==="/dimensions"||t.settings.route===a?l:""},n=Boolean(typeof window!="undefined"&&((s=(o=window.chrome)==null?void 0:o.runtime)==null?void 0:s.id));return e("nav",{css:L`
44
44
  background: var(--brand-secondary-1);
45
45
  padding: var(--spacing-base);
46
46
  min-width: 200px;
47
47
  display: flex;
48
48
  flex-direction: column;
49
- `},e("a",{css:x`
49
+ `},e("a",{css:L`
50
50
  flex-grow: 0;
51
51
  display: inline-block;
52
52
  margin: 0 var(--spacing-base);
53
- `,href:"https://uniform.dev/"},e("svg",{css:{display:"block"},width:"120",height:"38",viewBox:"0 0 120 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("g",{clipPath:"url(#clip0_41_612)"},e("path",{d:"M8.82261 3.73315L0 8.82209V18.9999L8.82261 13.911L17.6474 8.82209L8.82261 3.73315Z",fill:"#83C6E1"}),e("path",{d:"M8.82261 24.089V13.9111L0 19.0001V29.1779L8.82261 34.2669L17.6474 29.1779V19.0001L8.82261 24.089Z",fill:"#438FD5"}),e("path",{d:"M17.6474 8.82202L8.82263 13.911L17.6474 18.9999V29.1777L26.47 24.0888V13.911L17.6474 8.82202Z",fill:"#F4220B"}),e("path",{d:"M64.6069 13.9025H67.8036V25.5528H64.6069V13.9025ZM64.4902 8.5415H67.9181V11.7348H64.4902V8.5415ZM72.5153 10.1025V13.9025H70.3691V16.6272H72.5153V25.5528H75.7119V16.6272H78.2774V13.9025H75.7119V11.2684H78.2774V8.5415H75.2213L72.5153 10.1025ZM83.1059 13.7859L80.3999 15.3469V24.1084L83.1059 25.6694H88.0748L90.7808 24.1084V15.3469L88.0748 13.7859H83.1059ZM87.5842 22.9425H83.5943V16.5106H87.5842V22.9425ZM97.4723 14.8611L95.8103 13.9025H94.2779V25.5528H97.4745V16.6272H101.486V13.9025H99.1344L97.4723 14.8611ZM55.713 13.7859L53.8499 14.8611L51.9847 13.7859H50.7289V25.5528H53.9256V16.5106H57.9133V25.5528H61.1099V15.3469L58.4039 13.7859H55.713ZM44.0353 22.9425H40.0454V13.9025H36.851V24.1084L39.557 25.6694H42.3753L44.0309 24.7129L44.0331 24.7151L44.0353 24.7129V24.7151L45.6887 25.6694H47.2297V13.9025H44.0353V22.9425ZM117.51 13.7859H115.271L113.079 15.0425L110.909 13.7859H108.67L107.015 14.7402L105.359 13.7859H103.818V25.5528H107.015V16.5106H110.421V25.5528H113.615V16.5106H117.022V25.5528H120.216V15.3469L117.51 13.7859Z",fill:"white"})),e("defs",null,e("clipPath",{id:"clip0_41_612"},e("rect",{width:"120",height:"38",fill:"white"}))))),e("ul",{css:x`
53
+ `,href:"https://uniform.dev/"},e("svg",{css:{display:"block"},width:"120",height:"38",viewBox:"0 0 120 38",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("g",{clipPath:"url(#clip0_41_612)"},e("path",{d:"M8.82261 3.73315L0 8.82209V18.9999L8.82261 13.911L17.6474 8.82209L8.82261 3.73315Z",fill:"#83C6E1"}),e("path",{d:"M8.82261 24.089V13.9111L0 19.0001V29.1779L8.82261 34.2669L17.6474 29.1779V19.0001L8.82261 24.089Z",fill:"#438FD5"}),e("path",{d:"M17.6474 8.82202L8.82263 13.911L17.6474 18.9999V29.1777L26.47 24.0888V13.911L17.6474 8.82202Z",fill:"#F4220B"}),e("path",{d:"M64.6069 13.9025H67.8036V25.5528H64.6069V13.9025ZM64.4902 8.5415H67.9181V11.7348H64.4902V8.5415ZM72.5153 10.1025V13.9025H70.3691V16.6272H72.5153V25.5528H75.7119V16.6272H78.2774V13.9025H75.7119V11.2684H78.2774V8.5415H75.2213L72.5153 10.1025ZM83.1059 13.7859L80.3999 15.3469V24.1084L83.1059 25.6694H88.0748L90.7808 24.1084V15.3469L88.0748 13.7859H83.1059ZM87.5842 22.9425H83.5943V16.5106H87.5842V22.9425ZM97.4723 14.8611L95.8103 13.9025H94.2779V25.5528H97.4745V16.6272H101.486V13.9025H99.1344L97.4723 14.8611ZM55.713 13.7859L53.8499 14.8611L51.9847 13.7859H50.7289V25.5528H53.9256V16.5106H57.9133V25.5528H61.1099V15.3469L58.4039 13.7859H55.713ZM44.0353 22.9425H40.0454V13.9025H36.851V24.1084L39.557 25.6694H42.3753L44.0309 24.7129L44.0331 24.7151L44.0353 24.7129V24.7151L45.6887 25.6694H47.2297V13.9025H44.0353V22.9425ZM117.51 13.7859H115.271L113.079 15.0425L110.909 13.7859H108.67L107.015 14.7402L105.359 13.7859H103.818V25.5528H107.015V16.5106H110.421V25.5528H113.615V16.5106H117.022V25.5528H120.216V15.3469L117.51 13.7859Z",fill:"white"})),e("defs",null,e("clipPath",{id:"clip0_41_612"},e("rect",{width:"120",height:"38",fill:"white"}))))),e("ul",{css:L`
54
54
  display: flex;
55
55
  flex-flow: column nowrap;
56
56
  padding: 0;
57
57
  margin: 0;
58
58
  list-style-type: none;
59
59
  flex-grow: 1;
60
- `},ft.map((a,l)=>{var m,u,s,c;let p=0;return a.href==="/overrides"&&Object.keys((m=t.settings.scoreOverrides)!=null?m:{}).length>0&&(p=Object.keys((u=t.settings.scoreOverrides)!=null?u:{}).length),a.href==="/quirks"&&Object.keys((s=t.settings.quirkOverrides)!=null?s:{}).length>0&&(p=Object.keys((c=t.settings.quirkOverrides)!=null?c:{}).length),e("li",{css:x`
60
+ `},at.map((a,l)=>{var m,u,i,d;let p=0;return a.href==="/overrides"&&Object.keys((m=t.settings.scoreOverrides)!=null?m:{}).length>0&&(p=Object.keys((u=t.settings.scoreOverrides)!=null?u:{}).length),a.href==="/quirks"&&Object.keys((i=t.settings.quirkOverrides)!=null?i:{}).length>0&&(p=Object.keys((d=t.settings.quirkOverrides)!=null?d:{}).length),e("li",{css:L`
61
61
  padding: 0;
62
62
  margin: 0;
63
63
  list-style-type: none;
@@ -65,7 +65,7 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{css as x}fro
65
65
  &:last-of-type {
66
66
  margin-top: auto;
67
67
  }
68
- `,key:l},e(H,{css:x`
68
+ `,key:l},e(H,{css:L`
69
69
  align-items: center;
70
70
  border-radius: var(--rounded-base);
71
71
  display: flex;
@@ -79,11 +79,11 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{css as x}fro
79
79
  &.active {
80
80
  background: var(--gray-700);
81
81
  }
82
- `,className:r(a.href),route:a.href},e("i",{css:x`
82
+ `,className:r(a.href),route:a.href},e("i",{css:L`
83
83
  align-items: center;
84
84
  display: flex;
85
- `,dangerouslySetInnerHTML:{__html:a.icon}}),a.title,p?e("span",{css:x`
86
- font-size: var(--font-xxs);
85
+ `,dangerouslySetInnerHTML:{__html:a.icon}}),a.title,p?e("span",{css:L`
86
+ font-size: var(--fs-xxs);
87
87
  display: inline-block;
88
88
  width: 12px;
89
89
  height: 12px;
@@ -91,11 +91,11 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{css as x}fro
91
91
  background-color: var(--red-tooltip);
92
92
  text-align: center;
93
93
  line-height: 12px;
94
- `},p):null))})),!n&&e("a",{target:"_blank",href:"https://chrome.google.com/webstore/detail/uniform-context/dcmlokofjljnfjcknpmhjocogllfbhkg",css:x`
94
+ `},p):null))})),!n&&e("a",{target:"_blank",href:"https://chrome.google.com/webstore/detail/uniform-context/dcmlokofjljnfjcknpmhjocogllfbhkg",css:L`
95
95
  align-items: center;
96
96
  border-radius: var(--rounded-base);
97
97
  display: flex;
98
- font-size: var(--font-sm);
98
+ font-size: var(--fs-sm);
99
99
  color: var(--white);
100
100
  gap: var(--spacing-sm);
101
101
  padding: var(--spacing-sm) var(--spacing-base);
@@ -106,14 +106,14 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{css as x}fro
106
106
  &.active {
107
107
  background: var(--gray-700);
108
108
  }
109
- `,rel:"noreferrer"},e("i",{css:x`
109
+ `,rel:"noreferrer"},e("i",{css:L`
110
110
  align-items: center;
111
111
  display: flex;
112
- `,dangerouslySetInnerHTML:{__html:vt}}),"Install Chrome Extension"))};var Ce=()=>e("article",null,e("h1",null,"Something when wrong"),e("p",null,"We could not find the page you're looking for."));import*as ne from"react";import{css as M}from"@emotion/react";import*as G from"react";var we=M({willChange:"height"}),ht=M`
112
+ `,dangerouslySetInnerHTML:{__html:ct}}),"Install Chrome Extension"))};var he=()=>e("article",null,e("h1",null,"Something when wrong"),e("p",null,"We could not find the page you're looking for."));import*as oe from"react";import{css as M}from"@emotion/react";import*as _ from"react";var be=M({willChange:"height"}),dt=M`
113
113
  border-bottom: 2px solid var(--brand-secondary-1);
114
- font-size: var(--font-base);
114
+ font-size: var(--fs-base);
115
115
  margin: 0;
116
- `,bt=M`
116
+ `,lt=M`
117
117
  align-items: center;
118
118
  border: none;
119
119
  background: none;
@@ -121,15 +121,15 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{css as x}fro
121
121
  display: flex;
122
122
  width: 100%;
123
123
  padding: var(--spacing-sm) 0;
124
- font-weight: var(--font-bold);
124
+ font-weight: var(--fw-bold);
125
125
  justify-content: space-between;
126
- `,yt=M`
126
+ `,pt=M`
127
127
  align-self: center;
128
- `,Ct=M`
128
+ `,mt=M`
129
129
  transform: rotate(-180deg);
130
- `,$=({children:t})=>e("div",{css:[we]},t),K=({title:t,children:r})=>{let[n,o]=G.useState(!1),i=t.split(" ").join("-").toLocaleLowerCase();return e(G.Fragment,null,e("h3",{css:ht},e("button",{"aria-expanded":n,css:bt,title:t,id:i,"aria-controls":`${i}-section`,onClick:()=>o(a=>!a),type:"button"},t,e("i",{css:[yt,n?Ct:void 0]},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M6.34317 7.75732L4.92896 9.17154L12 16.2426L19.0711 9.17157L17.6569 7.75735L12 13.4142L6.34317 7.75732Z",fill:"currentColor"}))))),e("div",{id:`${i}-section`,css:[we,M`
130
+ `,G=({children:t})=>e("div",{css:[be]},t),$=({title:t,children:r})=>{let[n,o]=_.useState(!1),s=t.split(" ").join("-").toLocaleLowerCase();return e(_.Fragment,null,e("h3",{css:dt},e("button",{"aria-expanded":n,css:lt,title:t,id:s,"aria-controls":`${s}-section`,onClick:()=>o(a=>!a),type:"button"},t,e("i",{css:[pt,n?mt:void 0]},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M6.34317 7.75732L4.92896 9.17154L12 16.2426L19.0711 9.17157L17.6569 7.75735L12 13.4142L6.34317 7.75732Z",fill:"currentColor"}))))),e("div",{id:`${s}-section`,css:[be,M`
131
131
  padding: var(--spacing-sm) 0;
132
- `],role:"region","aria-labelledby":i},n?r:null))};import{css as A}from"@emotion/react";var W=A`
132
+ `],role:"region","aria-labelledby":s},n?r:null))};import{css as A}from"@emotion/react";var K=A`
133
133
  background-color: var(--gray-100);
134
134
  padding: var(--spacing-base) var(--spacing-md);
135
135
  margin: var(--spacing-base) 0;
@@ -137,21 +137,21 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{css as x}fro
137
137
  &:first-of-type {
138
138
  margin: 0 0 var(--spacing-base);
139
139
  }
140
- `,ke=A`
140
+ `,ye=A`
141
141
  background: var(--gray-100)
142
142
  url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%0A%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M9 2C8.44771 2 8 2.44772 8 3V5C8 5.55228 8.44771 6 9 6C9.55229 6 10 5.55228 10 5V3C10 2.44772 9.55229 2 9 2ZM8 9H16V11C16 13.2091 14.2091 15 12 15C9.79086 15 8 13.2091 8 11V9ZM13 16.917C15.8377 16.441 18 13.973 18 11V7H6V11C6 13.973 8.16229 16.441 11 16.917V22C11 22.5523 11.4477 23 12 23C12.5523 23 13 22.5523 13 22V16.917ZM14 3C14 2.44772 14.4477 2 15 2C15.5523 2 16 2.44772 16 3V5C16 5.55228 15.5523 6 15 6C14.4477 6 14 5.55228 14 5V3Z' fill='%232ecdb4' /%3E%3C/svg%3E")
143
143
  no-repeat var(--spacing-sm) var(--spacing-base);
144
144
  padding: var(--spacing-base) var(--spacing-xl);
145
- `,Y=A`
145
+ `,W=A`
146
146
  color: var(--brand-secondary-1);
147
147
  margin: 0;
148
- font-size: var(--font-base);
149
- font-weight: var(--font-bold);
150
- `,J=A`
148
+ font-size: var(--fs-base);
149
+ font-weight: var(--fw-bold);
150
+ `,Y=A`
151
151
  color: var(--brand-secondary-1);
152
152
  margin: var(--spacing-xs) 0 0;
153
- font-size: var(--font-sm);
154
- `,Te=A`
153
+ font-size: var(--fs-sm);
154
+ `,Ce=A`
155
155
  align-items: center;
156
156
  border: none;
157
157
  background: transparent
@@ -171,39 +171,39 @@ import{jsx as e}from"@emotion/react";import*as y from"react";import{css as x}fro
171
171
  &:hover {
172
172
  opacity: 0.6;
173
173
  }
174
- `,X=A`
174
+ `,J=A`
175
175
  display: flex;
176
176
  margin: var(--spacing-sm) 0 0;
177
177
  gap: var(--spacing-base);
178
- `;var E=({title:t,text:r,buttonGroup:n,children:o})=>e("div",{css:W},e("h2",{css:Y},t),e("p",{css:J},r),o,n?e("div",{css:X},n):null);import{css as D,keyframes as wt}from"@emotion/react";var kt=wt`from {
178
+ `;var E=({title:t,text:r,buttonGroup:n,children:o})=>e("div",{css:K},e("h2",{css:W},t),e("p",{css:Y},r),o,n?e("div",{css:J},n):null);import{css as S,keyframes as ut}from"@emotion/react";var gt=ut`from {
179
179
  transform: scale(1);
180
180
  }
181
181
  to {
182
182
  transform: scale(1.2);
183
183
  }
184
- `,b={page:D`
184
+ `,b={page:S`
185
185
  color: var(--brand-secondary-1);
186
- `,text:D`
186
+ `,text:S`
187
187
  margin: var(--spacing-sm) 0;
188
- `,reset:D`
188
+ `,reset:S`
189
189
  margin: 0 var(--spacing-md);
190
- font-size: var(--font-sm);
190
+ font-size: var(--fs-sm);
191
191
  color: var(--gray-500);
192
- `,title:D`
192
+ `,title:S`
193
193
  margin: 0 0 var(--spacing-sm);
194
- font-size: var(--font-md);
194
+ font-size: var(--fs-md);
195
195
  & > small {
196
196
  display: block;
197
- font-size: var(--font-xs);
198
- font-weight: var(--font-regular);
197
+ font-size: var(--fs-xs);
198
+ font-weight: var(--fw-regular);
199
199
  margin: var(--spacing-xxs) 0 0;
200
200
  }
201
- `,headingGroup:D`
201
+ `,headingGroup:S`
202
202
  align-items: baseline;
203
203
  display: flex;
204
204
  justify-content: space-between;
205
205
  align-items: center;
206
- `,divider:D`
206
+ `,divider:S`
207
207
  background: var(--gray-300);
208
208
  display: block;
209
209
  width: 1px;
@@ -211,66 +211,67 @@ to {
211
211
  position: absolute;
212
212
  inset: 0 auto 0 0;
213
213
  margin: auto 0;
214
- `,submitButton:D`
214
+ `,submitButton:S`
215
215
  position: absolute;
216
216
  right: var(--spacing-base);
217
217
  bottom: var(--spacing-base);
218
- animation: 0.5s 2 alternate ${kt};
219
- `,cancelButton:D`
218
+ animation: 0.5s 2 alternate ${gt};
219
+ `,cancelButton:S`
220
220
  position: absolute;
221
221
  left: calc(200px + var(--spacing-base));
222
222
  bottom: var(--spacing-base);
223
223
  background: white;
224
224
  padding: var(--spacing-sm);
225
225
  border: 1px solid var(--gray-300);
226
- `,error:D`
226
+ `,error:S`
227
227
  color: var(--brand-secondary-5);
228
- font-size: var(--font-sm);
229
- `,quirks:D`
228
+ font-size: var(--fs-sm);
229
+ `,quirks:S`
230
230
  .uniform-input-select,
231
231
  input {
232
232
  padding: var(--spacing-sm);
233
233
  }
234
- `};import{css as L}from"@emotion/react";var j=({children:t})=>e("table",{css:L`
234
+ `};import{css as O}from"@emotion/react";var X=({children:t})=>e("table",{css:O`
235
235
  border-collapse: collapse;
236
236
  display: table;
237
237
  width: 100%;
238
- font-size: var(--font-sm);
239
- `},t),Se=({children:t})=>e("thead",{css:L`
238
+ font-size: var(--fs-sm);
239
+ `},t),we=({children:t})=>e("thead",{css:O`
240
240
  background: var(--gray-50);
241
241
  text-align: left;
242
242
  & tr {
243
243
  border-bottom: 1px solid var(--gray-200);
244
244
  }
245
- `},t),ee=({children:t})=>e("tbody",null,t),B=({border:t,children:r})=>e("tr",{css:t?L`
245
+ `},t),j=({children:t})=>e("tbody",null,t),F=({border:t,children:r})=>e("tr",{css:t?O`
246
246
  border-bottom: 1px solid var(--gray-200);
247
247
  &:where(:last-child) {
248
248
  border: none;
249
249
  }
250
- `:void 0},r),te=({children:t,width:r})=>e("th",{css:L`
250
+ `:void 0},r),ee=({children:t,width:r})=>e("th",{css:O`
251
251
  outline: none;
252
252
  padding: var(--spacing-sm);
253
253
  width: ${r!=null?r:"auto"};
254
- `},t);function Tt(t){switch(t){case"light":return L`
254
+ `},t);function vt(t){switch(t){case"light":return O`
255
255
  color: var(--gray-400);
256
- `;case"dark":return L`
256
+ `;case"dark":return O`
257
257
  color: var(--brand-secondary-1);
258
- `}}function St(t){return L`
258
+ `}}function ft(t){return O`
259
259
  text-align: ${t};
260
- `}var I=({alignment:t="left",border:r,color:n="dark",children:o})=>e("td",{css:[L`
260
+ `}var R=({alignment:t="left",border:r,color:n="dark",children:o})=>e("td",{css:[O`
261
261
  padding: var(--spacing-base);
262
262
  max-width: 180px;
263
263
  overflow-wrap: break-word;
264
264
  position: relative;
265
- `,Tt(n),St(t),r?L`
265
+ `,vt(n),ft(t),r?O`
266
266
  border-left: 1px solid var(--gray-200);
267
- `:void 0]},o);import{css as ce}from"@emotion/react";var De=ce`
267
+ `:void 0]},o);import{css as se}from"@emotion/react";var ke=se`
268
268
  position: relative;
269
269
  display: inline-block;
270
- font-size: var(--font-base);
271
- `,xe=ce`
270
+ font-size: var(--fs-base);
271
+ `,Te=se`
272
272
  display: block;
273
- `,Le=ce`
273
+ text-decoration: line-through;
274
+ `,De=se`
274
275
  position: absolute;
275
276
  width: 6px;
276
277
  height: 6px;
@@ -278,95 +279,26 @@ to {
278
279
  top: 9px;
279
280
  background: var(--red-tooltip);
280
281
  border-radius: 3px;
281
- `;import{css as Dt}from"@emotion/react";var xt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
282
+ `;import{css as ht}from"@emotion/react";var bt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
282
283
  <path d="M4.2 7.2C4.53137 7.2 4.8 6.93137 4.8 6.6C4.8 6.26863 4.53137 6 4.2 6C3.86863 6 3.6 6.26863 3.6 6.6C3.6 6.93137 3.86863 7.2 4.2 7.2Z" fill="#828282"/>
283
284
  <path d="M8.4 6.6C8.4 6.93137 8.13137 7.2 7.8 7.2C7.46863 7.2 7.2 6.93137 7.2 6.6C7.2 6.26863 7.46863 6 7.8 6C8.13137 6 8.4 6.26863 8.4 6.6Z" fill="#828282"/>
284
285
  <path fill-rule="evenodd" clip-rule="evenodd" d="M6 12C9.31371 12 12 9.31371 12 6C12 2.68629 9.31371 0 6 0C2.68629 0 0 2.68629 0 6C0 9.31371 2.68629 12 6 12ZM6 10.8C8.65097 10.8 10.8 8.65097 10.8 6C10.8 5.49824 10.723 5.01447 10.5802 4.55984C10.0795 4.69533 9.55274 4.76763 9.00913 4.76763C6.77526 4.76763 4.82652 3.54683 3.79366 1.73601C2.25282 2.53492 1.2 4.14451 1.2 6C1.2 8.65097 3.34903 10.8 6 10.8Z" fill="#828282"/>
285
- </svg>`,Lt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
286
+ </svg>`,yt=`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
286
287
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3.59995 5.05775C4.9254 5.05775 5.99992 3.98325 5.99992 2.65778C5.99992 1.33232 4.9254 0.257812 3.59995 0.257812C2.27448 0.257812 1.19998 1.33232 1.19998 2.65778C1.19998 3.98325 2.27448 5.05775 3.59995 5.05775ZM3.59999 3.85777C4.26272 3.85777 4.79997 3.32052 4.79997 2.65778C4.79997 1.99505 4.26272 1.4578 3.59999 1.4578C2.93725 1.4578 2.4 1.99505 2.4 2.65778C2.4 3.32052 2.93725 3.85777 3.59999 3.85777Z" fill="#828282"/>
287
288
  <path d="M5.39993 6.8577C5.73131 6.8577 5.99993 7.12632 5.99993 7.45769V11.0576H7.19991V7.45769C7.19991 6.46356 6.39406 5.65771 5.39993 5.65771H1.79998C0.80588 5.65771 0 6.46356 0 7.45769V11.0576H1.19999V7.45769C1.19999 7.12632 1.46861 6.8577 1.79998 6.8577H5.39993Z" fill="#828282"/>
288
289
  <path d="M11.9999 5.05762H8.3999V6.2576H11.9999V5.05762Z" fill="#828282"/>
289
290
  <path d="M8.3999 7.45752H11.9999V8.6575H8.3999V7.45752Z" fill="#828282"/>
290
291
  <path d="M11.9999 2.65771H8.3999V3.8577H11.9999V2.65771Z" fill="#828282"/>
291
- </svg>`,Oe=`<svg width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg">
292
+ </svg>`,Se=`<svg width="15" height="11" viewBox="0 0 15 11" fill="none" xmlns="http://www.w3.org/2000/svg">
292
293
  <path fill-rule="evenodd" clip-rule="evenodd" d="M7.113 3.12646C8.16729 3.12646 9.02195 3.98113 9.02195 5.03541C9.02195 5.86658 8.49075 6.57368 7.74932 6.83573V10.1259H6.47669V6.83573C5.73526 6.57368 5.20405 5.86658 5.20405 5.03541C5.20405 3.98113 6.05872 3.12646 7.113 3.12646ZM7.113 4.39909C7.46443 4.39909 7.74932 4.68398 7.74932 5.03541C7.74932 5.38684 7.46443 5.67172 7.113 5.67172C6.76158 5.67172 6.47669 5.38684 6.47669 5.03541C6.47669 4.68398 6.76158 4.39909 7.113 4.39909Z" fill="#828282"/>
293
294
  <path d="M3.96336 1.88578C3.15733 2.69183 2.65879 3.80537 2.65879 5.03535C2.65879 6.42093 3.29145 7.65875 4.28366 8.47569L5.1895 7.56984C4.42501 6.98876 3.93142 6.06969 3.93142 5.03535C3.93142 4.1568 4.28752 3.36142 4.86325 2.78567L3.96336 1.88578Z" fill="#828282"/>
294
295
  <path d="M9.36269 2.7856C9.93846 3.36136 10.2946 4.15676 10.2946 5.03535C10.2946 6.06973 9.80096 6.98882 9.03643 7.5699L9.94228 8.47575C10.9345 7.65881 11.5672 6.42096 11.5672 5.03535C11.5672 3.80533 11.0687 2.69177 10.2626 1.88571L9.36269 2.7856Z" fill="#828282"/>
295
296
  <path d="M0.113525 5.03534C0.113525 3.10251 0.896953 1.35266 2.16359 0.0860049L3.06347 0.985892C2.02714 2.02224 1.38616 3.45394 1.38616 5.03534C1.38616 6.61674 2.02714 8.04844 3.06347 9.08479L2.16358 9.98468C0.89695 8.71802 0.113525 6.96817 0.113525 5.03534Z" fill="#828282"/>
296
297
  <path d="M12.0624 9.98474C13.329 8.71809 14.1125 6.96821 14.1125 5.03534C14.1125 3.10248 13.329 1.3526 12.0624 0.0859375L11.1625 0.985824C12.1988 2.02218 12.8398 3.4539 12.8398 5.03534C12.8398 6.61678 12.1988 8.0485 11.1625 9.08486L12.0624 9.98474Z" fill="#828282"/>
297
- </svg>`,Ie=({type:t})=>{let r="";switch(t){case"Audience":r=xt;break;case"Signal":r=Oe;break;case"Intent":r=Oe;break;case"Enrichment":r=Lt;break}return e("i",{css:Dt`
298
+ </svg>`,Le=({type:t})=>{let r="";switch(t){case"Audience":r=bt;break;case"Signal":r=Se;break;case"Intent":r=Se;break;case"Enrichment":r=yt;break}return e("i",{css:ht`
298
299
  align-items: center;
299
300
  display: inline-block;
300
- `,dangerouslySetInnerHTML:{__html:r}})};var Ot=({dimensionIndex:t,dimensions:r,disableEditOverride:n,onClick:o,preemptiveOverrides:i})=>{var p;let{settings:a}=_(),l=(p=i!=null?i:a.scoreOverrides)!=null?p:{};return e(j,null,e(ee,null,Object.entries(r).sort(([m],[u])=>m.localeCompare(u)).map(([m,u])=>{var C;let{dim:s,name:c,type:d,category:v}=(C=t[m])!=null?C:{name:m,dim:m,type:void 0,category:void 0},h=l[s];return e(B,{key:s},e(I,null,h!==void 0?e("s",{css:xe},h.initial):null,e("b",{css:De},u,h!==void 0&&e("i",{css:Le}))),e(I,null,e("div",{onClick:()=>o==null?void 0:o(s),css:o?{cursor:"pointer"}:void 0},e("span",{css:b.divider,role:"presentation"}),e("div",null,e(Ie,{type:d})," ",d),e("strong",null,v?`${v}:`:""," ",c))),e(I,{alignment:"right",color:"light"},h!==void 0&&!n?e(H,{route:`/overrides/${s}`},"Edit override"):null))})))},R=Ot;async function oe({actions:t,saveSettings:r,scores:n,settings:o}){var p,m;let i=(p=o.scoreOverrides)!=null?p:{},a={...i},l=[];for(let u of Object.keys(i)){let s=i==null?void 0:i[u];delete a[u],l.push({type:"modscoreS",data:{dimension:u,delta:s.initial-((m=n[u])!=null?m:0)}})}await r({...o,scoreOverrides:a}),await t.rawUpdate(l)}async function Re({quirk:t,settings:r,saveSettings:n,actions:o}){var l;let i=(l=r.quirkOverrides)==null?void 0:l[t];if(!i)return;let a={...r.quirkOverrides};delete a[t],await n({...r,quirkOverrides:a}),await o.rawUpdate([{type:"setquirk",data:{key:t,value:i.initial}}])}import{Button as Ee}from"@uniformdev/design-system";import*as Ae from"react";import{css as Q}from"@emotion/react";var Ve=Q`
301
- position: relative;
302
- display: inline-block;
303
- margin-right: var(--spacing-sm);
304
- transition: var(--duration) var(--timing);
305
- vertical-align: middle;
306
- user-select: none;
307
- width: var(--spacing-xl);
308
- `,Pe=Q`
309
- appearance: none;
310
- border-radius: var(--rounded-full);
311
- background-color: var(--white);
312
- border: 2px solid var(--gray-400);
313
- cursor: pointer;
314
- position: absolute;
315
- display: block;
316
- width: var(--spacing-md);
317
- height: var(--spacing-md);
318
- transition: transform var(--duration) var(--timing), background-color var(--duration) var(--timing),
319
- background-image var(--duration) var(--timing);
320
-
321
- &:focus {
322
- outline: 3px solid var(--brand-primary-1);
323
- outline-offset: 2px;
324
- }
325
-
326
- &:checked {
327
- background-color: var(--brand-secondary-3);
328
- background-image: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%0A%3E%3Cpath d='M10.5858 13.4142L7.75735 10.5858L6.34314 12L10.5858 16.2427L17.6568 9.1716L16.2426 7.75739L10.5858 13.4142Z' fill='%23fff' /%3E%3C/svg%3E");
329
- background-position: center center;
330
- border-color: var(--brand-secondary-3);
331
- transform: translateX(var(--spacing-base));
332
-
333
- &:hover,
334
- &:focus {
335
- border-color: var(--brand-primary-1);
336
- background-color: var(--brand-primary-1);
337
- }
338
- }
339
- `,He=Q`
340
- border-radius: var(--rounded-full);
341
- background-color: var(--gray-300);
342
- cursor: pointer;
343
- display: block;
344
- overflow: hidden;
345
- width: var(--spacing-xl);
346
- height: var(--spacing-md);
347
- `,Me=Q`
348
- color: var(--brand-secondary-1);
349
- font-weight: var(--font-bold);
350
- line-height: 1.25rem;
351
- cursor: default;
352
- `,re=Q`
353
- color: var(--gray-700);
354
- font-size: var(--font-sm);
355
- margin: var(--spacing-sm) 0;
356
- `;var q=({label:t,infoText:r,toggleText:n,...o})=>{let i=()=>r&&n?o.checked?e("p",{css:re},n):e("p",{css:re},r):r?e("p",{css:re},r):null;return e(Ae.Fragment,null,e("div",{css:Ve},e("input",{type:"checkbox",css:Pe,...o,className:o.className}),e("label",{htmlFor:o.id,css:He})),e("label",{htmlFor:o.id,css:Me},t),i())};var ze=({dimensionIndex:{index:t},state:{scores:r,data:n},actions:o,saveSettings:i,settings:a})=>{let l=ne.useMemo(()=>{let s={};return Object.keys(t).filter(c=>!r[c]).map(c=>{s[t[c].dim]=0}),s},[r,t]),p=Object.keys(r).length,m=p+Object.keys(l).length,u=()=>{o.rawUpdate([{type:"setcontrol",data:!n.controlGroup}])};return e(ne.Fragment,null,e("article",{css:b.page},e("div",{css:b.headingGroup},e("h2",{css:b.title},"Dimensions",e("small",null,p," active of ",m)),e("div",{css:b.reset},e(Ee,{buttonType:"ghost",onClick:()=>oe({actions:o,saveSettings:i,scores:r,settings:a}).then(o.forget)},"clear all dimensions")),e(q,{name:"controlGroup",label:"Control Group",onChange:u,checked:n.controlGroup})),p>0?e(R,{dimensionIndex:t,dimensions:r}):e(E,{title:n.controlGroup?"In control group":"No active dimensions",text:n.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have score in any dimensions yet.",buttonGroup:n.controlGroup?e(Ee,{buttonType:"secondary",onClick:u},"Exit control group"):null}),e($,null,e(K,{title:`Inactive Dimensions (${Object.keys(l).length})`},e(R,{dimensionIndex:t,dimensions:l})))))};import*as Be from"react";import{css as It}from"@emotion/react";function de({onClick:t}){return e("button",{css:It`
357
- width: 3.5rem;
358
- height: 3.5rem;
359
- display: flex;
360
- align-items: center;
361
- border-radius: 9999px;
362
- border: none;
363
- cursor: pointer;
364
- background-color: var(--red-button);
365
-
366
- svg {
367
- color: var(--red-button);
368
- }
369
- `,onClick:t,"aria-label":"Add new override",className:"text-secondary shadow-xl rounded-full flex items-center bg-secondary","data-test-id":"add-new-overrides-button"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"66",height:"66",viewBox:"0 0 66 66"},e("g",{fill:"none",fillRule:"evenodd"},e("circle",{cx:"33",cy:"33",r:"33",fill:"currentColor"}),e("g",{fill:"#FFF",transform:"translate(19 19)"},e("rect",{width:"4",height:"28",x:"12",rx:"2"}),e("path",{d:"M14,0 C15.1045695,-2.02906125e-16 16,0.8954305 16,2 L16,26 C16,27.1045695 15.1045695,28 14,28 C12.8954305,28 12,27.1045695 12,26 L12,2 C12,0.8954305 12.8954305,2.02906125e-16 14,0 Z",transform:"rotate(90 14 14)"})))))}import{Button as Fe}from"@uniformdev/design-system";var Qe=({dimensionIndex:{index:t},state:{data:r,scores:n},actions:o,settings:i,saveSettings:a})=>{var c;let l=(c=i.scoreOverrides)!=null?c:{},p=Object.keys(l).length,m=d=>(d.preventDefault(),a({...i,route:"/overrides/add"})),u=()=>{o.rawUpdate([{type:"setcontrol",data:!r.controlGroup}])},s={};return Object.entries(n).map(([d,v])=>{l[d]!==void 0&&(s[d]=v)}),e(Be.Fragment,null,e("article",{css:b.page},e("div",{css:b.headingGroup},e("h2",{css:b.title},"What if?"),e("div",{css:b.reset},e(Fe,{buttonType:"ghost",onClick:()=>oe({actions:o,settings:i,saveSettings:a,scores:n})},"delete all overrides")),e(de,{onClick:m})),e("p",null,"Override dimension scores to test personalization"),p>0?e(R,{dimensionIndex:t,dimensions:s,onClick:d=>a({...i,route:`/overrides/${d}`})}):e(E,{title:r.controlGroup?"In control group":"No overrides",text:r.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have any dimension overrides yet.",buttonGroup:r.controlGroup?e(Fe,{buttonType:"secondary",onClick:u},"Exit control group"):null})))};import{Field as Ke,Form as Ft,Formik as Bt}from"formik";import*as z from"yup";import{css as V}from"@emotion/react";var qe=V`
301
+ `,dangerouslySetInnerHTML:{__html:r}})};var Ct=({dimensionIndex:t,dimensions:r,disableEditOverride:n,onClick:o,preemptiveOverrides:s})=>{var p;let{settings:a}=U(),l=(p=s!=null?s:a.scoreOverrides)!=null?p:{};return e(X,null,e(j,null,Object.entries(r).sort(([m],[u])=>m.localeCompare(u)).map(([m,u])=>{var C;let{dim:i,name:d,type:c,category:f}=(C=t[m])!=null?C:{name:m,dim:m,type:void 0,category:void 0},h=l[i];return e(F,{key:i},e(R,null,h!==void 0?e("s",{css:Te},h.initial):null,e("b",{css:ke},u,h!==void 0&&e("i",{css:De}))),e(R,null,e("div",{onClick:()=>o==null?void 0:o(i),css:o?{cursor:"pointer"}:void 0},e("span",{css:b.divider,role:"presentation"}),e("div",null,e(Le,{type:c})," ",c),e("strong",null,f?`${f}:`:""," ",d))),e(R,{alignment:"right",color:"light"},h!==void 0&&!n?e(H,{route:`/overrides/${i}`},"Edit override"):null))})))},V=Ct;async function te({actions:t,saveSettings:r,scores:n,settings:o}){var p,m;let s=(p=o.scoreOverrides)!=null?p:{},a={...s},l=[];for(let u of Object.keys(s)){let i=s==null?void 0:s[u];delete a[u],l.push({type:"modscoreS",data:{dimension:u,delta:i.initial-((m=n[u])!=null?m:0)}})}await r({...o,scoreOverrides:a}),await t.rawUpdate(l)}async function Oe({quirk:t,settings:r,saveSettings:n,actions:o}){var l;let s=(l=r.quirkOverrides)==null?void 0:l[t];if(!s)return;let a={...r.quirkOverrides};delete a[t],await n({...r,quirkOverrides:a}),await o.rawUpdate([{type:"setquirk",data:{key:t,value:s.initial}}])}import{Button as xe}from"@uniformdev/design-system";import{Switch as wt}from"@uniformdev/design-system";var Re=({dimensionIndex:{index:t},state:{scores:r,data:n},actions:o,saveSettings:s,settings:a})=>{let l=oe.useMemo(()=>{let i={};return Object.keys(t).filter(d=>!r[d]).map(d=>{i[t[d].dim]=0}),i},[r,t]),p=Object.keys(r).length,m=p+Object.keys(l).length,u=()=>{o.rawUpdate([{type:"setcontrol",data:!n.controlGroup}])};return e(oe.Fragment,null,e("article",{css:b.page},e("div",{css:b.headingGroup},e("h2",{css:b.title},"Dimensions",e("small",null,p," active of ",m)),e("div",{css:b.reset},e(xe,{buttonType:"ghost",onClick:()=>te({actions:o,saveSettings:s,scores:r,settings:a}).then(o.forget)},"clear all dimensions")),e(wt,{name:"controlGroup",label:"Control Group",onChange:u,checked:n.controlGroup})),p>0?e(V,{dimensionIndex:t,dimensions:r}):e(E,{title:n.controlGroup?"In control group":"No active dimensions",text:n.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have score in any dimensions yet.",buttonGroup:n.controlGroup?e(xe,{buttonType:"secondary",onClick:u},"Exit control group"):null}),e(G,null,e($,{title:`Inactive Dimensions (${Object.keys(l).length})`},e(V,{dimensionIndex:t,dimensions:l})))))};import*as Ie from"react";import{AddButton as kt}from"@uniformdev/design-system";import{Button as Ve}from"@uniformdev/design-system";var Pe=({dimensionIndex:{index:t},state:{data:r,scores:n},actions:o,settings:s,saveSettings:a})=>{var d;let l=(d=s.scoreOverrides)!=null?d:{},p=Object.keys(l).length,m=c=>(c==null||c.preventDefault(),a({...s,route:"/overrides/add"})),u=()=>{o.rawUpdate([{type:"setcontrol",data:!r.controlGroup}])},i={};return Object.entries(n).map(([c,f])=>{l[c]!==void 0&&(i[c]=f)}),e(Ie.Fragment,null,e("article",{css:b.page},e("div",{css:b.headingGroup},e("h2",{css:b.title},"What if?"),e("div",{css:b.reset},e(Ve,{buttonType:"ghost",onClick:()=>te({actions:o,settings:s,saveSettings:a,scores:n})},"delete all overrides")),e(kt,{onClick:m})),e("p",null,"Override dimension scores to test personalization"),p>0?e(V,{dimensionIndex:t,dimensions:i,onClick:c=>a({...s,route:`/overrides/${c}`})}):e(E,{title:r.controlGroup?"In control group":"No overrides",text:r.controlGroup?"You are part of the personalization control group. While in the control group you do not have dimension scores and will not see personalized content. A/B tests will still run.":"You do not have any dimension overrides yet.",buttonGroup:r.controlGroup?e(Ve,{buttonType:"secondary",onClick:u},"Exit control group"):null})))};import{Field as qe,Form as It,Formik as Pt}from"formik";import*as B from"yup";import{css as I}from"@emotion/react";var He=I`
370
302
  background: var(--white);
371
303
  border: 1px solid var(--gray-500);
372
304
  border-radius: var(--rounded-base);
@@ -377,26 +309,26 @@ to {
377
309
  cursor: not-allowed;
378
310
  color: var(--gray-200);
379
311
  }
380
- `,wr=V`
312
+ `,lr=I`
381
313
  margin: var(--spacing-base) 0;
382
- `,Ne=V`
314
+ `,Me=I`
383
315
  color: var(--brand-secondary-1);
384
316
  display: flex;
385
317
  flex-direction: column;
386
318
  margin: 0 0 var(--spacing-sm);
387
- `,Ze=V`
319
+ `,Ae=I`
388
320
  color: var(--brand-secondary-1);
389
321
  display: block;
390
322
  flex: 1 100%;
391
- font-weight: var(--font-bold);
323
+ font-weight: var(--fw-bold);
392
324
  margin: 0 0 var(--spacing-sm);
393
- `,kr=V`
325
+ `,pr=I`
394
326
  color: var(--gray-600);
395
- font-size: var(--font-sm);
396
- `,Tr=V`
327
+ font-size: var(--fs-sm);
328
+ `,mr=I`
397
329
  color: var(--brand-secondary-5);
398
330
  display: block;
399
- `,Ue=V`
331
+ `,Ee=I`
400
332
  flex-direction: row;
401
333
  flex-wrap: wrap;
402
334
 
@@ -464,383 +396,28 @@ to {
464
396
  flex: 1 0 20%;
465
397
  padding: 10px;
466
398
  }
467
- `;import{Caption as Rt,ErrorMessage as Vt}from"@uniformdev/design-system";var _e=({field:t,form:r,meta:n,...o})=>{var u,s;let{label:i,caption:a,min:l=0,max:p=100,step:m}=o;return e("div",null,e("label",{css:[Ne,Ue]},e("span",{css:Ze},i),e("input",{type:"range",min:l,max:p,step:m,...t,value:(u=t.value)!=null?u:0}),e("span",{className:"value-display"},(s=t.value)!=null?s:0)),a?e(Rt,null,a):null,r.touched[t.name]&&r.errors[t.name]?e(Vt,{message:r.errors[t.name]}):null)};import{css as Pt}from"@emotion/react";var P=({children:t,...r})=>e("fieldset",{css:Pt`
399
+ `;import{Caption as Tt,ErrorMessage as Dt}from"@uniformdev/design-system";var Be=({field:t,form:r,meta:n,...o})=>{var u,i;let{label:s,caption:a,min:l=0,max:p=100,step:m}=o;return e("div",null,e("label",{css:[Me,Ee]},e("span",{css:Ae},s),e("input",{type:"range",min:l,max:p,step:m,...t,value:(u=t.value)!=null?u:0}),e("span",{className:"value-display"},(i=t.value)!=null?i:0)),a?e(Tt,null,a):null,r.touched[t.name]&&r.errors[t.name]?e(Dt,{message:r.errors[t.name]}):null)};import{css as St}from"@emotion/react";var P=({children:t,...r})=>e("fieldset",{css:St`
468
400
  border: none;
469
401
  padding: 0;
470
402
  & legend {
471
403
  margin-bottom: var(--spacing-base);
472
404
  }
473
- `,...r},t);import{css as Ht}from"@emotion/react";var N=({children:t})=>e("legend",{css:Ht`
474
- font-size: var(--font-md);
475
- font-weight: var(--font-bold);
405
+ `,...r},t);import{css as Lt}from"@emotion/react";var q=({children:t})=>e("legend",{css:Lt`
406
+ font-size: var(--fs-md);
407
+ font-weight: var(--fw-bold);
476
408
  border-bottom: 1px solid var(--gray-400);
477
409
  width: 100%;
478
- `},t);import{Context as Mt,TransitionDataStore as At}from"@uniformdev/context";function Ge({manifest:t,visitor:r,override:n}){let o=new Mt({manifest:t,transitionStore:new le({initialData:r})}),i={...o.scores};o.storage.updateData([n]);let l={...{...o.scores}};return Object.entries(l).forEach(([p,m])=>{i[p]===m&&delete l[p]}),l}var le=class extends At{async handleDelete(){}async handleUpdateData(){}};function Z({scores:t,scoreOverrides:r}){let n=[];return r?(Object.entries(r).forEach(([o,i])=>{var p;let a=(p=t[o])!=null?p:0;if(a===i.override)return;let l=i.override-a;n.push({type:"modscoreS",data:{dimension:o,delta:l}})}),n):[]}function ie({quirks:t,quirkOverrides:r}){let n={};if(!!r)return Object.entries(r).forEach(([o,i])=>{t[o]!==i.override&&(n[o]=i.override)}),Object.keys(n).length>0?n:void 0}import{Button as Qt}from"@uniformdev/design-system";var pe=t=>({field:r,form:n,meta:o,...i})=>e(t,{...i,...r,errorMessage:n.errors[r.name]});import{Input as Et,InputSelect as zt}from"@uniformdev/design-system";var se=pe(Et),$e=pe(zt);var qt=z.object({dimension:z.string(),score:z.number()}),me=({settings:t,saveSettings:r,state:n,actions:o,dimensionIndex:{index:i}})=>{var m,u;let a=t.route?[...t.route.matchAll(/overrides\/(?!.*add)(\w+)?/g)]:[],l=a[0]?a[0][1]:"";if(!((m=n.manifest.project.pz)!=null&&m.sig))return e("p",null,"Error, manifest is broken or there is no signal to override.");let p=Object.entries(i).filter(([,s])=>s.type!=="Audience"&&s.type!=="Intent").map(([s,c])=>{let d=c.type?`${c.type}: `:"",v=c.category?`${c.category} - `:"",h=`${d}${v}${c.name}`;return{value:s,label:h}});return p.unshift({value:"",label:"Choose dimension to override"}),e(Bt,{initialValues:{dimension:l,score:(u=n.scores[l])!=null?u:0},validate:s=>{let c={};return(s.score===n.scores[s.dimension]||s.score===0&&!n.scores[l])&&(c.score="You have to modify current score value"),c},validationSchema:qt,enableReinitialize:!0,validateOnChange:!1,validateOnBlur:!1,onSubmit:async s=>{var C,w,k,S,F,ve;let c=(w=(C=i[s.dimension])==null?void 0:C.cap)!=null?w:0,d=Math.min(s.score,c),v={...t,scoreOverrides:{...t.scoreOverrides,[s.dimension]:{initial:(ve=(F=(S=(k=t.scoreOverrides)==null?void 0:k[s.dimension])==null?void 0:S.initial)!=null?F:n.scores[s.dimension])!=null?ve:0,override:d}},route:"/overrides"};await r(v);let h=Z({scores:n.scores,scoreOverrides:v.scoreOverrides});o.rawUpdate(h)}},({isSubmitting:s,values:c})=>{var w;let d=Ge({manifest:n.manifest,visitor:n.data,override:{type:"modscore",data:{dimension:c.dimension,delta:c.score-((w=n.scores[c.dimension])!=null?w:0)}}}),v=Object.entries(n.scores).reduce((k,[S,F])=>(k[S]={initial:F,override:F},k),{}),h={max:100,step:50};i[c.dimension]&&(h.max=i[c.dimension].cap,h.step=i[c.dimension].str);let C=c.score&&Object.keys(d).length>0;return e(Ft,{css:b.page},e("h1",{css:b.title},"Override Dimension"),e(Ke,{component:$e,label:"Dimension",id:"dimension",name:"dimension",options:p,disabled:s}),e("p",{css:b.text},e("small",null,"Audiences and Intents are aggregated from other dimension scores and cannot be overridden directly.")),c.dimension?e(Ke,{component:_e,name:"score",label:"Score",disabled:s,caption:`Range: 0 - ${h.max} in increments of ${h.step}`}):null,e(P,{disabled:s,css:{marginBottom:"2rem"}},C?e($,null,e(K,{title:`Impacted Dimensions (${Object.keys(d).length})`},e(R,{preemptiveOverrides:v,dimensionIndex:i,dimensions:d,disableEditOverride:!0}))):null,e(Qt,{type:"submit",css:b.submitButton,disabled:s},"Save"),e(H,{route:"/overrides",css:b.cancelButton},"Cancel")))})};import{useState as $t}from"react";import{useState as Nt,useEffect as Zt}from"react";import{Button as Ut,Input as _t}from"@uniformdev/design-system";var Gt=({name:t,value:r,submit:n})=>{let[o,i]=Nt(r!=null?r:"");return Zt(()=>{i(r!=null?r:"")},[r]),e("div",{css:{display:"flex",gap:"var(--spacing-sm)"}},e(_t,{type:"text",css:[qe],name:t,value:o,onChange:p=>{i(p.target.value)}}),e(Ut,{buttonType:"primary",disabled:o===r,size:"sm",onClick:()=>n(t,o!=null?o:"")},"Save"))},We=Gt;import{Button as Ye,InputSelect as Kt}from"@uniformdev/design-system";var Je=({...t})=>{let{state:{data:{quirks:r}},quirksIndex:{index:n},settings:o,saveSettings:i,actions:a}=t,[l,p]=$t(""),m;l&&(m=n[l]);let u=async(s,c)=>{var h,C,w;p("");let d={...o,quirkOverrides:{...o.quirkOverrides,[s]:{initial:(w=(C=(h=o.quirkOverrides)==null?void 0:h[s])==null?void 0:C.initial)!=null?w:r[s],override:c}}};await i(d);let v=ie({quirks:r,quirkOverrides:d.quirkOverrides});await a.update({quirks:v})};return e(y.Fragment,null,e("article",{css:[b.page,b.quirks]},e("h1",{css:b.title},"Quirks"),e("p",{css:b.text},"Keys defined in Uniform and their current, programmatically defined values for this visit."),Object.keys(n).length?e(j,null,e(Se,null,e(B,null,e(te,{width:"30%"},"Key"),e(te,{width:"50%"},"Value"),e(te,{width:"20%"},""))),e(ee,null,Object.values(n).map(({name:s,value:c,id:d})=>{var C,w,k;let v=(w=(C=o.quirkOverrides)==null?void 0:C[s])==null?void 0:w.initial,h=[];return m&&m.options&&(h=m.options.map(S=>({value:S.value,label:S.name}))),e(B,{key:d,border:"bottom"},e(I,null,e("strong",null,s)),e(I,null,l!==d?e("div",{onClick:()=>{p(d)}},v?e("div",null,e("s",null,v)):null,c):null,l===d&&m&&e(y.Fragment,null,m.options?e(Kt,{showLabel:!1,label:`Change ${s}`,defaultOption:`Change ${s}`,name:d,onChange:S=>u(S.target.name,S.target.value),options:h}):e(We,{name:d,value:c,submit:u}))),e(I,null,l?null:(k=o.quirkOverrides)!=null&&k[d]?e(Ye,{buttonType:"ghost",onClick:()=>{Re({quirk:d,settings:o,saveSettings:i,actions:a})}},e("small",null,"Clear Override")):e(Ye,{buttonType:"ghost",onClick:()=>{p(d)}},e("small",null,"Override"))))}))):e(E,{title:"No quirks configured",text:"There are currently no quirks setup. Try to connect to Uniform API to load additional information about Quirks and Quirks without defined value."})))};import{Button as Wt}from"@uniformdev/design-system";var Xe=({settings:t,saveSettings:r,actions:n,state:{data:o}})=>e("article",{css:[b.page,{display:"flex",flexDirection:"column",gap:"var(--spacing-base)"}]},e("h1",{css:b.title},"Settings"),e(P,null,e(N,null,"Data Connection"),e(Wt,{buttonType:"tertiary",onClick:()=>{r({...t,route:"/connect"})}},"Manage Connection to Uniform")),e(P,null,e(N,null,"Storage Consent"),e(q,{label:"Store visitor data",id:"consent-mode",name:"consentMode",checked:o.consent,onChange:i=>{n.rawUpdate([{type:"consent",data:i.currentTarget.checked}]),r({...t,consentMode:i.currentTarget.checked})}}),e("p",null,e("small",null,"Enabling storage consent allows storing behavior in this browser for personalization across sessions. Only affects this browser. Personalization works with this disabled, but dimension scores are lost on refresh."))),e(P,null,e(N,null,"Logging"),e(q,{label:"Write Uniform Context diagnostic logs to browser console",id:"logging",name:"logging",checked:t.logLevel!=="none",onChange:i=>r({...t,logLevel:i.currentTarget.checked?"debug":"none"})})));import{Button as je}from"@uniformdev/design-system";var ue=({settings:t,saveSettings:r})=>{let n=()=>{r({...t,route:"/connect"})},o=()=>{r({...t,ignoreApiKeyPrompt:!0})},i=t.route==="/connect",a=!(t!=null&&t.apiKey);return!t.ignoreApiKeyPrompt&&a&&!i?e("div",{css:[W,ke]},e("h2",{css:Y},"Connect to a Uniform Project"),e("p",{css:J},"This allows reading human-readable labels for the dimensions."),e("div",{css:X},e(je,{buttonType:"secondary",onClick:n},"Connect this site"),e(je,{buttonType:"ghost",onClick:o},"Skip for now")),e("button",{type:"button",css:Te,title:"close",onClick:o},e("span",{hidden:!0},"Close"))):null};import{computeDimensionDefinitionDisplayData as Yt,computeDimensionDisplayData as et,DimensionClient as Jt}from"@uniformdev/context/api";import{useAsync as Xt}from"react-use";import*as tt from"react";function ot({apiHost:t,apiKey:r,projectId:n},o){let{loading:i,error:a,value:l}=Xt(async()=>{if(!r||!n)return p;let u=(await new Jt({projectId:n,apiKey:r,apiHost:t||void 0}).get()).dimensions,s={};return u.map(c=>{var d,v,h,C;if(s[c.dim]={...Yt(c),cap:c.cap,str:10},s[c.dim].type==="Enrichment"){let w=c.dim.split("_")[0];s[c.dim].cap=(C=(h=(v=(d=o==null?void 0:o.project.pz)==null?void 0:d.enr)==null?void 0:v[w])==null?void 0:h.cap)!=null?C:100}}),s},[t,r,n]),p=tt.useMemo(()=>{var u,s,c,d;let m={};return o&&(Object.entries((s=(u=o==null?void 0:o.project.pz)==null?void 0:u.sig)!=null?s:{}).map(([v,h])=>{let C=et(v,o);C&&(m[v]={...h,...C})}),Object.entries((d=(c=o==null?void 0:o.project.pz)==null?void 0:c.enr)!=null?d:{}).map(([v,h])=>{var k;let C=et(v,o),w={cap:(k=h.cap)!=null?k:100,str:10};C&&(m[v]={...C,cap:w.cap,str:w.str})}),l&&Object.entries(l).map(([v,h])=>{m[v]={...m[v],...h}})),m},[o,l]);return{loading:i,error:a,index:p}}import{useMemo as jt}from"react";import{QuirkClient as eo}from"@uniformdev/context/api";import{useAsync as to}from"react-use";function rt({apiHost:t,apiKey:r,projectId:n},o){let{loading:i,error:a,value:l}=to(async()=>{if(!r||!n)return{};let u=await new eo({projectId:n,apiKey:r,apiHost:t||void 0}).get(),s={};return u.quirks.map(c=>{s[c.id]={...c,value:o[c.id]}}),s},[t,r,n]),p=jt(()=>{let m={};return Object.entries(o).map(([u,s])=>m[u]={value:s,id:u,name:u}),l&&Object.entries(l).map(([u,s])=>m[u]={...s,value:o[u]}),m},[o,l]);return{loading:i,error:a,index:p}}import{css as at}from"@emotion/react";function ae(){return e("style",null,`
410
+ `},t);import{Context as Ot,TransitionDataStore as xt}from"@uniformdev/context";function Qe({manifest:t,visitor:r,override:n}){let o=new Ot({manifest:t,transitionStore:new ae({initialData:r})}),s={...o.scores};o.storage.updateData([n]);let l={...{...o.scores}};return Object.entries(l).forEach(([p,m])=>{s[p]===m&&delete l[p]}),l}var ae=class extends xt{async handleDelete(){}async handleUpdateData(){}};function N({scores:t,scoreOverrides:r}){let n=[];return r?(Object.entries(r).forEach(([o,s])=>{var p;let a=(p=t[o])!=null?p:0;if(a===s.override)return;let l=s.override-a;n.push({type:"modscoreS",data:{dimension:o,delta:l}})}),n):[]}function re({quirks:t,quirkOverrides:r}){let n={};if(!!r)return Object.entries(r).forEach(([o,s])=>{t[o]!==s.override&&(n[o]=s.override)}),Object.keys(n).length>0?n:void 0}import{Button as Ht}from"@uniformdev/design-system";var ce=t=>({field:r,form:n,meta:o,...s})=>e(t,{...s,...r,errorMessage:n.errors[r.name]});import{Input as Rt,InputSelect as Vt}from"@uniformdev/design-system";var ne=ce(Rt),Fe=ce(Vt);var Mt=B.object({dimension:B.string(),score:B.number()}),de=({settings:t,saveSettings:r,state:n,actions:o,dimensionIndex:{index:s}})=>{var m,u;let a=t.route?[...t.route.matchAll(/overrides\/(?!.*add)(\w+)?/g)]:[],l=a[0]?a[0][1]:"";if(!((m=n.manifest.project.pz)!=null&&m.sig))return e("p",null,"Error, manifest is broken or there is no signal to override.");let p=Object.entries(s).filter(([,i])=>i.type!=="Audience"&&i.type!=="Intent").map(([i,d])=>{let c=d.type?`${d.type}: `:"",f=d.category?`${d.category} - `:"",h=`${c}${f}${d.name}`;return{value:i,label:h}});return p.unshift({value:"",label:"Choose dimension to override"}),e(Pt,{initialValues:{dimension:l,score:(u=n.scores[l])!=null?u:0},validate:i=>{let d={};return(i.score===n.scores[i.dimension]||i.score===0&&!n.scores[l])&&(d.score="You have to modify current score value"),d},validationSchema:Mt,enableReinitialize:!0,validateOnChange:!1,validateOnBlur:!1,onSubmit:async i=>{var C,w,k,D,Q,ue;let d=(w=(C=s[i.dimension])==null?void 0:C.cap)!=null?w:0,c=Math.min(i.score,d),f={...t,scoreOverrides:{...t.scoreOverrides,[i.dimension]:{initial:(ue=(Q=(D=(k=t.scoreOverrides)==null?void 0:k[i.dimension])==null?void 0:D.initial)!=null?Q:n.scores[i.dimension])!=null?ue:0,override:c}},route:"/overrides"};await r(f);let h=N({scores:n.scores,scoreOverrides:f.scoreOverrides});o.rawUpdate(h)}},({isSubmitting:i,values:d})=>{var w;let c=Qe({manifest:n.manifest,visitor:n.data,override:{type:"modscore",data:{dimension:d.dimension,delta:d.score-((w=n.scores[d.dimension])!=null?w:0)}}}),f=Object.entries(n.scores).reduce((k,[D,Q])=>(k[D]={initial:Q,override:Q},k),{}),h={max:100,step:50};s[d.dimension]&&(h.max=s[d.dimension].cap,h.step=s[d.dimension].str);let C=d.score&&Object.keys(c).length>0;return e(It,{css:b.page},e("h1",{css:b.title},"Override Dimension"),e(qe,{component:Fe,label:"Dimension",id:"dimension",name:"dimension",options:p,disabled:i}),e("p",{css:b.text},e("small",null,"Audiences and Intents are aggregated from other dimension scores and cannot be overridden directly.")),d.dimension?e(qe,{component:Be,name:"score",label:"Score",disabled:i,caption:`Range: 0 - ${h.max} in increments of ${h.step}`}):null,e(P,{disabled:i,css:{marginBottom:"2rem"}},C?e(G,null,e($,{title:`Impacted Dimensions (${Object.keys(c).length})`},e(V,{preemptiveOverrides:f,dimensionIndex:s,dimensions:c,disableEditOverride:!0}))):null,e(Ht,{type:"submit",css:b.submitButton,disabled:i},"Save"),e(H,{route:"/overrides",css:b.cancelButton},"Cancel")))})};import{useState as qt}from"react";import{useState as At,useEffect as Et}from"react";import{Button as Bt,Input as Qt}from"@uniformdev/design-system";var Ft=({name:t,value:r,submit:n})=>{let[o,s]=At(r!=null?r:"");return Et(()=>{s(r!=null?r:"")},[r]),e("div",{css:{display:"flex",gap:"var(--spacing-sm)"}},e(Qt,{type:"text",css:[He],name:t,value:o,onChange:p=>{s(p.target.value)}}),e(Bt,{buttonType:"primary",disabled:o===r,size:"sm",onClick:()=>n(t,o!=null?o:"")},"Save"))},Ne=Ft;import{Button as Ze,InputSelect as Nt}from"@uniformdev/design-system";var ze=({...t})=>{let{state:{data:{quirks:r}},quirksIndex:{index:n},settings:o,saveSettings:s,actions:a}=t,[l,p]=qt(""),m;l&&(m=n[l]);let u=async(i,d)=>{var h,C,w;p("");let c={...o,quirkOverrides:{...o.quirkOverrides,[i]:{initial:(w=(C=(h=o.quirkOverrides)==null?void 0:h[i])==null?void 0:C.initial)!=null?w:r[i],override:d}}};await s(c);let f=re({quirks:r,quirkOverrides:c.quirkOverrides});await a.update({quirks:f})};return e(y.Fragment,null,e("article",{css:[b.page,b.quirks]},e("h1",{css:b.title},"Quirks"),e("p",{css:b.text},"Keys defined in Uniform and their current, programmatically defined values for this visit."),Object.keys(n).length?e(X,null,e(we,null,e(F,null,e(ee,{width:"30%"},"Key"),e(ee,{width:"50%"},"Value"),e(ee,{width:"20%"},""))),e(j,null,Object.values(n).map(({name:i,value:d,id:c})=>{var C,w,k;let f=(w=(C=o.quirkOverrides)==null?void 0:C[i])==null?void 0:w.initial,h=[];return m&&m.options&&(h=m.options.map(D=>({value:D.value,label:D.name}))),e(F,{key:c,border:"bottom"},e(R,null,e("strong",null,i)),e(R,null,l!==c?e("div",{onClick:()=>{p(c)}},f?e("div",null,e("s",null,f)):null,d):null,l===c&&m&&e(y.Fragment,null,m.options?e(Nt,{showLabel:!1,label:`Change ${i}`,defaultOption:`Change ${i}`,name:c,onChange:D=>u(D.target.name,D.target.value),options:h}):e(Ne,{name:c,value:d,submit:u}))),e(R,null,l?null:(k=o.quirkOverrides)!=null&&k[c]?e(Ze,{buttonType:"ghost",onClick:()=>{Oe({quirk:c,settings:o,saveSettings:s,actions:a})}},e("small",null,"Clear Override")):e(Ze,{buttonType:"ghost",onClick:()=>{p(c)}},e("small",null,"Override"))))}))):e(E,{title:"No quirks configured",text:"There are currently no quirks setup. Try to connect to Uniform API to load additional information about Quirks and Quirks without defined value."})))};import{Button as Zt}from"@uniformdev/design-system";import{Switch as Ue}from"@uniformdev/design-system";var _e=({settings:t,saveSettings:r,actions:n,state:{data:o}})=>e("article",{css:[b.page,{display:"flex",flexDirection:"column",gap:"var(--spacing-base)"}]},e("h1",{css:b.title},"Settings"),e(P,null,e(q,null,"Data Connection"),e(Zt,{buttonType:"tertiary",onClick:()=>{r({...t,route:"/connect"})}},"Manage Connection to Uniform")),e(P,null,e(q,null,"Storage Consent"),e(Ue,{label:"Store visitor data",id:"consent-mode",name:"consentMode",checked:o.consent,onChange:s=>{n.rawUpdate([{type:"consent",data:s.currentTarget.checked}]),r({...t,consentMode:s.currentTarget.checked})}}),e("p",null,e("small",null,"Enabling storage consent allows storing behavior in this browser for personalization across sessions. Only affects this browser. Personalization works with this disabled, but dimension scores are lost on refresh."))),e(P,null,e(q,null,"Logging"),e(Ue,{label:"Write Uniform Context diagnostic logs to browser console",id:"logging",name:"logging",checked:t.logLevel==="debug",onChange:s=>r({...t,logLevel:s.currentTarget.checked?"debug":"none"})})));import{Button as Ge}from"@uniformdev/design-system";var le=({settings:t,saveSettings:r})=>{let n=()=>{r({...t,route:"/connect"})},o=()=>{r({...t,ignoreApiKeyPrompt:!0})},s=t.route==="/connect",a=!(t!=null&&t.apiKey);return!t.ignoreApiKeyPrompt&&a&&!s?e("div",{css:[K,ye]},e("h2",{css:W},"Connect to a Uniform Project"),e("p",{css:Y},"This allows reading human-readable labels for the dimensions."),e("div",{css:J},e(Ge,{buttonType:"secondary",onClick:n},"Connect this site"),e(Ge,{buttonType:"ghost",onClick:o},"Skip for now")),e("button",{type:"button",css:Ce,title:"close",onClick:o},e("span",{hidden:!0},"Close"))):null};import{computeDimensionDefinitionDisplayData as zt,computeDimensionDisplayData as $e,DimensionClient as Ut}from"@uniformdev/context/api";import{useAsync as _t}from"react-use";import*as Ke from"react";function We({apiHost:t,apiKey:r,projectId:n},o){let{loading:s,error:a,value:l}=_t(async()=>{if(!r||!n)return p;let u=(await new Ut({projectId:n,apiKey:r,apiHost:t||void 0}).get()).dimensions,i={};return u.map(d=>{var c,f,h,C;if(i[d.dim]={...zt(d),cap:d.cap,str:10},i[d.dim].type==="Enrichment"){let w=d.dim.split("_")[0];i[d.dim].cap=(C=(h=(f=(c=o==null?void 0:o.project.pz)==null?void 0:c.enr)==null?void 0:f[w])==null?void 0:h.cap)!=null?C:100}}),i},[t,r,n]),p=Ke.useMemo(()=>{var u,i,d,c;let m={};return o&&(Object.entries((i=(u=o==null?void 0:o.project.pz)==null?void 0:u.sig)!=null?i:{}).map(([f,h])=>{let C=$e(f,o);C&&(m[f]={...h,...C})}),Object.entries((c=(d=o==null?void 0:o.project.pz)==null?void 0:d.enr)!=null?c:{}).map(([f,h])=>{var k;let C=$e(f,o),w={cap:(k=h.cap)!=null?k:100,str:10};C&&(m[f]={...C,cap:w.cap,str:w.str})}),l&&Object.entries(l).map(([f,h])=>{m[f]={...m[f],...h}})),m},[o,l]);return{loading:s,error:a,index:p}}import{useMemo as Gt}from"react";import{QuirkClient as $t}from"@uniformdev/context/api";import{useAsync as Kt}from"react-use";function Ye({apiHost:t,apiKey:r,projectId:n},o){let{loading:s,error:a,value:l}=Kt(async()=>{if(!r||!n)return{};let u=await new $t({projectId:n,apiKey:r,apiHost:t||void 0}).get(),i={};return u.quirks.map(d=>{i[d.id]={...d,value:o[d.id]}}),i},[t,r,n]),p=Gt(()=>{let m={};return Object.entries(o).map(([u,i])=>m[u]={value:i,id:u,name:u}),l&&Object.entries(l).map(([u,i])=>m[u]={...i,value:o[u]}),m},[o,l]);return{loading:s,error:a,index:p}}import{css as et}from"@emotion/react";import{Theme as so}from"@uniformdev/design-system";function ie(){return e("style",null,`
479
411
  :root {
480
- --brand-primary-1: #438fd5; /* bright blue */
481
- --brand-primary-2: #f4220b; /* red */
482
- --brand-primary-3: #83c6e1; /* slate blue */
483
-
484
- /* secondary colours */
485
- --brand-secondary-1: #1f2b34; /* carbon */
486
- --brand-secondary-2: #ecf1f1; /* silver */
487
- --brand-secondary-3: #2ecdb4; /* teal */
488
- --brand-secondary-4: #f6f1c3; /* yellow */
489
- --brand-secondary-5: #d9534f; /* brick red */
490
- --brand-secondary-6: #dbf6f2; /* mint */
491
-
492
- /* off brand */
493
- --input-border: rgba(31, 43, 52, 0.5);
494
-
495
- /* site settings */
496
412
  --site-width: 700px;
497
- --min-height: 450px;
498
-
499
- --spacing-base: 1.15rem;
500
- --spacing-xs: calc(var(--spacing-base) - 0.75rem);
501
- --spacing-sm: calc(var(--spacing-base) - 0.5rem);
502
- --spacing-md: calc(var(--spacing-base) * 1.5);
503
- --spacing-lg: calc(var(--spacing-base) * 2);
504
- --spacing-xl: calc(var(--spacing-base) * 2.5);
505
-
506
- /* font sizes */
507
- --font-base: 1rem; /* 16px */
508
- --font-xxs: calc(var(--font-base) - 0.5rem);
509
- --font-xs: calc(var(--font-base) - 0.25rem);
510
- --font-sm: calc(var(--font-base) - 0.125rem); /* 14px */
511
- --font-md: calc(var(--font-base) * 1.25);
512
- --font-lg: calc(var(--font-base) * 1.5);
513
-
514
- /* font-weight */
515
- --font-regular: 400;
516
- --font-bold: 700;
517
-
518
- /* brand shadow styles */
519
- --shadow-base: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
520
-
521
- /* rounder corners */
522
- --rounded-base: 6px;
523
- --rounded-full: 99999px;
524
-
525
- /* gray spectrum */
526
- --white: #fff;
527
- --gray-50: #f9fafb;
528
- --gray-100: #f3f4f6;
529
- --gray-200: #e5e7eb;
530
- --gray-300: #d1d5db;
531
- --gray-400: #9ca3af;
532
- --gray-500: #6b7280;
533
- --gray-600: #4b5563;
534
- --gray-700: #374151;
535
- --gray-800: #1f2937;
536
- --gray-900: #111827;
537
413
 
538
414
  /* Red CTA */
539
415
  --red-button: rgb(217 83 79);
540
416
  --red-tooltip: #D9534F;
541
417
 
542
- /* z-indexs */
543
- --z-10: 10;
418
+ --min-height: 450px;
544
419
  }
545
-
546
- /*! modern-normalize v1.1.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
547
-
548
- /*
549
- Document
550
- ========
551
- */
552
-
553
- /**
554
- Use a better box model (opinionated).
555
- */
556
-
557
- *,
558
- ::before,
559
- ::after {
560
- box-sizing: border-box;
561
- }
562
-
563
- /**
564
- Use a more readable tab size (opinionated).
565
- */
566
-
567
- html {
568
- -moz-tab-size: 4;
569
- tab-size: 4;
570
- }
571
-
572
- /**
573
- 1. Correct the line height in all browsers.
574
- 2. Prevent adjustments of font size after orientation changes in iOS.
575
- */
576
-
577
- html {
578
- line-height: 1.15; /* 1 */
579
- -webkit-text-size-adjust: 100%; /* 2 */
580
- }
581
-
582
- /*
583
- Sections
584
- ========
585
- */
586
-
587
- /**
588
- Remove the margin in all browsers.
589
- */
590
-
591
- body {
592
- margin: 0;
593
- }
594
-
595
- /**
596
- Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
597
- */
598
-
599
- body {
600
- font-family:
601
- system-ui,
602
- -apple-system, /* Firefox supports this but not yet system-ui */
603
- 'Segoe UI',
604
- Roboto,
605
- Helvetica,
606
- Arial,
607
- sans-serif,
608
- 'Apple Color Emoji',
609
- 'Segoe UI Emoji';
610
- }
611
-
612
- /*
613
- Grouping content
614
- ================
615
- */
616
-
617
- /**
618
- 1. Add the correct height in Firefox.
619
- 2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
620
- */
621
-
622
- hr {
623
- height: 0; /* 1 */
624
- color: inherit; /* 2 */
625
- }
626
-
627
- /*
628
- Text-level semantics
629
- ====================
630
- */
631
-
632
- /**
633
- Add the correct text decoration in Chrome, Edge, and Safari.
634
- */
635
-
636
- abbr[title] {
637
- text-decoration: underline dotted;
638
- }
639
-
640
- /**
641
- Add the correct font weight in Edge and Safari.
642
- */
643
-
644
- b,
645
- strong {
646
- font-weight: bolder;
647
- }
648
-
649
- /**
650
- 1. Improve consistency of default fonts in all browsers. (https://github.com/sindresorhus/modern-normalize/issues/3)
651
- 2. Correct the odd 'em' font sizing in all browsers.
652
- */
653
-
654
- code,
655
- kbd,
656
- samp,
657
- pre {
658
- font-family:
659
- ui-monospace,
660
- SFMono-Regular,
661
- Consolas,
662
- 'Liberation Mono',
663
- Menlo,
664
- monospace; /* 1 */
665
- font-size: 1em; /* 2 */
666
- }
667
-
668
- /**
669
- Add the correct font size in all browsers.
670
- */
671
-
672
- small {
673
- font-size: 80%;
674
- }
675
-
676
- /**
677
- Prevent 'sub' and 'sup' elements from affecting the line height in all browsers.
678
- */
679
-
680
- sub,
681
- sup {
682
- font-size: 75%;
683
- line-height: 0;
684
- position: relative;
685
- vertical-align: baseline;
686
- }
687
-
688
- sub {
689
- bottom: -0.25em;
690
- }
691
-
692
- sup {
693
- top: -0.5em;
694
- }
695
-
696
- /*
697
- Tabular data
698
- ============
699
- */
700
-
701
- /**
702
- 1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
703
- 2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
704
- */
705
-
706
- table {
707
- text-indent: 0; /* 1 */
708
- border-color: inherit; /* 2 */
709
- }
710
-
711
- /*
712
- Forms
713
- =====
714
- */
715
-
716
- /**
717
- 1. Change the font styles in all browsers.
718
- 2. Remove the margin in Firefox and Safari.
719
- */
720
-
721
- button,
722
- input,
723
- optgroup,
724
- select,
725
- textarea {
726
- font-family: inherit; /* 1 */
727
- font-size: 100%; /* 1 */
728
- line-height: 1.15; /* 1 */
729
- margin: 0; /* 2 */
730
- }
731
-
732
- /**
733
- Remove the inheritance of text transform in Edge and Firefox.
734
- 1. Remove the inheritance of text transform in Firefox.
735
- */
736
-
737
- button,
738
- select { /* 1 */
739
- text-transform: none;
740
- }
741
-
742
- /**
743
- Correct the inability to style clickable types in iOS and Safari.
744
- */
745
-
746
- button,
747
- [type='button'],
748
- [type='reset'],
749
- [type='submit'] {
750
- -webkit-appearance: button;
751
- }
752
-
753
- /**
754
- Remove the inner border and padding in Firefox.
755
- */
756
-
757
- ::-moz-focus-inner {
758
- border-style: none;
759
- padding: 0;
760
- }
761
-
762
- /**
763
- Restore the focus styles unset by the previous rule.
764
- */
765
-
766
- :-moz-focusring {
767
- outline: 1px dotted ButtonText;
768
- }
769
-
770
- /**
771
- Remove the additional ':invalid' styles in Firefox.
772
- See: https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737
773
- */
774
-
775
- :-moz-ui-invalid {
776
- box-shadow: none;
777
- }
778
-
779
- /**
780
- Remove the padding so developers are not caught out when they zero out 'fieldset' elements in all browsers.
781
- */
782
-
783
- legend {
784
- padding: 0;
785
- }
786
-
787
- /**
788
- Add the correct vertical alignment in Chrome and Firefox.
789
- */
790
-
791
- progress {
792
- vertical-align: baseline;
793
- }
794
-
795
- /**
796
- Correct the cursor style of increment and decrement buttons in Safari.
797
- */
798
-
799
- ::-webkit-inner-spin-button,
800
- ::-webkit-outer-spin-button {
801
- height: auto;
802
- }
803
-
804
- /**
805
- 1. Correct the odd appearance in Chrome and Safari.
806
- 2. Correct the outline style in Safari.
807
- */
808
-
809
- [type='search'] {
810
- -webkit-appearance: textfield; /* 1 */
811
- outline-offset: -2px; /* 2 */
812
- }
813
-
814
- /**
815
- Remove the inner padding in Chrome and Safari on macOS.
816
- */
817
-
818
- ::-webkit-search-decoration {
819
- -webkit-appearance: none;
820
- }
821
-
822
- /**
823
- 1. Correct the inability to style clickable types in iOS and Safari.
824
- 2. Change font properties to 'inherit' in Safari.
825
- */
826
-
827
- ::-webkit-file-upload-button {
828
- -webkit-appearance: button; /* 1 */
829
- font: inherit; /* 2 */
830
- }
831
-
832
- /*
833
- Interactive
834
- ===========
835
- */
836
-
837
- /*
838
- Add the correct display in Chrome and Safari.
839
- */
840
-
841
- summary {
842
- display: list-item;
843
- }`)}import{useEffect as oo,useState as ro}from"react";import{useMountedState as no}from"react-use";var nt=()=>{let[t,r]=ro(!1),n=no();return oo(()=>{setTimeout(()=>{n()&&r(!0)},1e3)},[n]),t?e("article",{css:b.page},e("h1",null,"Loading..."),e("p",null,"Connecting to Uniform API for complete data.")):null};import{parseQuickConnect as io}from"@uniformdev/context";import{ApiClientError as so,ManifestClient as ao}from"@uniformdev/context/api";import{Field as ge,Form as co,Formik as lo}from"formik";import*as T from"react";import{ErrorMessage as po,Input as mo,Button as U}from"@uniformdev/design-system";function it(t){let[r,n]=T.useState(t.currentData?"c":"qc"),[o,i]=T.useState(void 0),[a,l]=T.useState(void 0),p=T.useCallback(async s=>{let c=new ao(s);i(void 0);try{let d=await c.get({preview:!0});return l({manifest:d,target:s}),d}catch(d){if(d instanceof so){d.statusCode===403?i("API key is valid but does not have Context > Read Drafts permission, or the API key does not have permissions to the project, or the project does not exist."):i(d.errorMessage);return}if("message"in d){d.message==="Failed to fetch"?i("A network error occurred. Ensure the API host is valid."):i(d.message);return}i(JSON.stringify(d,null,2));return}},[]);T.useEffect(()=>{!t.currentData||p(t.currentData)},[p,t.currentData]);let m=async s=>{await p(s)&&(n("c"),await t.onConnect(s))},u=()=>{confirm("Disconnect from Uniform? Make sure to save your API key if you want to reconnect.")&&(n("qc"),l(void 0),i(void 0),t.onConnect(null))};return e("div",null,o?e(po,{message:o}):null,r==="qc"||r==="mc"?e(uo,{...t,state:r,setState:n,onConnect:m}):e("div",null,a?e(T.Fragment,null,e("p",null,"Connected to"," ",e("a",{href:`${a==null?void 0:a.target.apiHost}/projects/${a==null?void 0:a.target.projectId}`,target:"_blank",rel:"noopener noreferrer",css:{textDecoration:"underline"}},e("strong",null,a==null?void 0:a.manifest.project.name))," ",e("small",null,"(",a==null?void 0:a.manifest.project.id,")")),e(U,{buttonType:"secondary",type:"button",onClick:u},"Disconnect")):null))}function uo({setState:t,state:r,currentData:n,onConnect:o}){var i,a,l;return e("div",null,e(lo,{initialValues:{apiHost:(i=n==null?void 0:n.apiHost)!=null?i:"https://uniform.dev",apiKey:(a=n==null?void 0:n.apiKey)!=null?a:"",projectId:(l=n==null?void 0:n.projectId)!=null?l:"",qc:""},onSubmit:o},({setFieldValue:p,setFieldError:m,errors:{qc:u},isSubmitting:s})=>e(co,null,e("fieldset",{css:{display:"flex",flexDirection:"column",gap:"var(--spacing-base)"}},r==="qc"?e(T.Fragment,null,e("div",null,e(mo,{placeholder:"Paste Quick Connect Code Here",caption:"Copy the Quick Connect code after creating an API key in Uniform.",errorMessage:u,onChange:c=>{try{let d=io(c.currentTarget.value);p("apiHost",d.apiHost),p("apiKey",d.apiKey),p("projectId",d.projectId)}catch(d){m("qc",d.message)}}})),e("section",{css:{display:"flex",gap:"var(--spacing-sm)"}},e(U,{type:"submit",buttonType:"primary",disabled:s},s?"Verifying...":"Connect"),e(U,{type:"button",buttonType:"ghost",onClick:()=>t("mc"),disabled:s},"Connect Manually"))):e(T.Fragment,null,e("div",null,e(ge,{component:se,label:"API Key",name:"apiKey",caption:"Generate an API key in your Uniform team settings."})),e("div",null,e(ge,{component:se,label:"Project ID",name:"projectId",caption:"Available to copy after generating an API key"})),e("div",null,e(ge,{component:se,label:"API Host",name:"apiHost",caption:"Use a non-standard Uniform API endpoint. Most people will not not need this option."})),e("section",{css:{display:"flex",gap:"var(--spacing-sm)"}},e(U,{type:"submit",buttonType:"primary",disabled:s},s?"Verifying...":"Connect"),e(U,{type:"button",buttonType:"ghost",onClick:()=>t("qc"),disabled:s},"Use Quick Connect")))))))}var st=({settings:t,saveSettings:r})=>{let n=t.apiKey&&t.projectId?{apiKey:t.apiKey,projectId:t.projectId,apiHost:t.apiHost}:void 0;return e("article",{css:b.page},e("h1",{css:b.title},"Connect to a Uniform Project"),e("p",{css:b.text},e("small",null,"Adding an API key and project ID enables human-readable dimension labels to be shown. You must have access to the Uniform project to do this.")),e(it,{onConnect:async o=>{o?await r({...t,apiKey:o.apiKey,projectId:o.projectId,apiHost:o.apiHost}):await r({...t,apiKey:void 0,projectId:void 0,apiHost:void 0})},currentData:n}))};var go=at`
420
+ `)}import{useEffect as Wt,useState as Yt}from"react";import{useMountedState as Jt}from"react-use";var Je=()=>{let[t,r]=Yt(!1),n=Jt();return Wt(()=>{setTimeout(()=>{n()&&r(!0)},1e3)},[n]),t?e("article",{css:b.page},e("h1",null,"Loading..."),e("p",null,"Connecting to Uniform API for complete data.")):null};import{parseQuickConnect as Xt}from"@uniformdev/context";import{ApiClientError as jt,ManifestClient as eo}from"@uniformdev/context/api";import{Field as pe,Form as to,Formik as oo}from"formik";import*as T from"react";import{ErrorMessage as ro,Input as no,Button as Z}from"@uniformdev/design-system";function Xe(t){let[r,n]=T.useState(t.currentData?"c":"qc"),[o,s]=T.useState(void 0),[a,l]=T.useState(void 0),p=T.useCallback(async i=>{let d=new eo(i);s(void 0);try{let c=await d.get({preview:!0});return l({manifest:c,target:i}),c}catch(c){if(c instanceof jt){c.statusCode===403?s("API key is valid but does not have Context > Read Drafts permission, or the API key does not have permissions to the project, or the project does not exist."):s(c.errorMessage);return}if("message"in c){c.message==="Failed to fetch"?s("A network error occurred. Ensure the API host is valid."):s(c.message);return}s(JSON.stringify(c,null,2));return}},[]);T.useEffect(()=>{!t.currentData||p(t.currentData)},[p,t.currentData]);let m=async i=>{await p(i)&&(n("c"),await t.onConnect(i))},u=()=>{confirm("Disconnect from Uniform? Make sure to save your API key if you want to reconnect.")&&(n("qc"),l(void 0),s(void 0),t.onConnect(null))};return e("div",null,o?e(ro,{message:o}):null,r==="qc"||r==="mc"?e(io,{...t,state:r,setState:n,onConnect:m}):e("div",null,a?e(T.Fragment,null,e("p",null,"Connected to"," ",e("a",{href:`${a==null?void 0:a.target.apiHost}/projects/${a==null?void 0:a.target.projectId}`,target:"_blank",rel:"noopener noreferrer",css:{textDecoration:"underline"}},e("strong",null,a==null?void 0:a.manifest.project.name))," ",e("small",null,"(",a==null?void 0:a.manifest.project.id,")")),e(Z,{buttonType:"secondary",type:"button",onClick:u},"Disconnect")):null))}function io({setState:t,state:r,currentData:n,onConnect:o}){var s,a,l;return e("div",null,e(oo,{initialValues:{apiHost:(s=n==null?void 0:n.apiHost)!=null?s:"https://uniform.dev",apiKey:(a=n==null?void 0:n.apiKey)!=null?a:"",projectId:(l=n==null?void 0:n.projectId)!=null?l:"",qc:""},onSubmit:o},({setFieldValue:p,setFieldError:m,errors:{qc:u},isSubmitting:i})=>e(to,null,e("fieldset",{css:{display:"flex",flexDirection:"column",gap:"var(--spacing-base)"}},r==="qc"?e(T.Fragment,null,e("div",null,e(no,{placeholder:"Paste Quick Connect Code Here",caption:"Copy the Quick Connect code after creating an API key in Uniform.",errorMessage:u,onChange:d=>{try{let c=Xt(d.currentTarget.value);p("apiHost",c.apiHost),p("apiKey",c.apiKey),p("projectId",c.projectId)}catch(c){m("qc",c.message)}}})),e("section",{css:{display:"flex",gap:"var(--spacing-sm)"}},e(Z,{type:"submit",buttonType:"primary",disabled:i},i?"Verifying...":"Connect"),e(Z,{type:"button",buttonType:"ghost",onClick:()=>t("mc"),disabled:i},"Connect Manually"))):e(T.Fragment,null,e("div",null,e(pe,{component:ne,label:"API Key",name:"apiKey",caption:"Generate an API key in your Uniform team settings."})),e("div",null,e(pe,{component:ne,label:"Project ID",name:"projectId",caption:"Available to copy after generating an API key"})),e("div",null,e(pe,{component:ne,label:"API Host",name:"apiHost",caption:"Use a non-standard Uniform API endpoint. Most people will not not need this option."})),e("section",{css:{display:"flex",gap:"var(--spacing-sm)"}},e(Z,{type:"submit",buttonType:"primary",disabled:i},i?"Verifying...":"Connect"),e(Z,{type:"button",buttonType:"ghost",onClick:()=>t("qc"),disabled:i},"Use Quick Connect")))))))}var je=({settings:t,saveSettings:r})=>{let n=t.apiKey&&t.projectId?{apiKey:t.apiKey,projectId:t.projectId,apiHost:t.apiHost}:void 0;return e("article",{css:b.page},e("h1",{css:b.title},"Connect to a Uniform Project"),e("p",{css:b.text},e("small",null,"Adding an API key and project ID enables human-readable dimension labels to be shown. You must have access to the Uniform project to do this.")),e(Xe,{onConnect:async o=>{o?await r({...t,apiKey:o.apiKey,projectId:o.projectId,apiHost:o.apiHost}):await r({...t,apiKey:void 0,projectId:void 0,apiHost:void 0})},currentData:n}))};var ao=et`
844
421
  background: var(--white);
845
422
  padding: var(--spacing-base);
846
423
  overflow-y: auto;
@@ -869,16 +446,16 @@ summary {
869
446
  &::-webkit-scrollbar-thumb:hover {
870
447
  background: var(--gray-500);
871
448
  }
872
- `;function ct(t){let r=ot(t.settings,t.state.manifest),n=rt(t.settings,t.state.data.quirks),o={...t,dimensionIndex:r,quirksIndex:n},i=()=>{var a;if(r.loading||n.loading)return e(nt,null);if(t.settings.route&&t.settings.route.match(/overrides\/\w+/))return e(me,{...o});switch((a=t.settings)==null?void 0:a.route){case void 0:case"/":case"/dimensions":return e(ze,{...o});case"/overrides":return e(Qe,{...o});case"/overrides/add":return e(me,{...o});case"/quirks":return e(Je,{...o});case"/settings":return e(Xe,{...o});case"/connect":return e(st,{...o});default:return e(Ce,null)}};return e(be,{settings:t.settings,saveSettings:t.saveSettings},e(ae,null),e("div",{css:at`
449
+ `;function tt(t){let r=We(t.settings,t.state.manifest),n=Ye(t.settings,t.state.data.quirks),o={...t,dimensionIndex:r,quirksIndex:n},s=()=>{var a;if(r.loading||n.loading)return e(Je,null);if(t.settings.route&&t.settings.route.match(/overrides\/\w+/))return e(de,{...o});switch((a=t.settings)==null?void 0:a.route){case void 0:case"/":case"/dimensions":return e(Re,{...o});case"/overrides":return e(Pe,{...o});case"/overrides/add":return e(de,{...o});case"/quirks":return e(ze,{...o});case"/settings":return e(_e,{...o});case"/connect":return e(je,{...o});default:return e(he,null)}};return e(ve,{settings:t.settings,saveSettings:t.saveSettings},e(so,null),e(ie,null),e("div",{css:et`
873
450
  display: grid;
874
451
  grid-template-columns: 200px auto;
875
- font-weight: var(--font-regular);
452
+ font-weight: var(--fs-base);
876
453
  font-size: var(--base-font-size);
877
454
  font-family: var(--base-font-family);
878
455
  line-height: var(--base-line-height);
879
456
  height: var(--min-height);
880
457
  min-width: var(--site-width);
881
- `},e(ye,{...t}),e("main",{css:go},e(ue,{...t}),i())))}import{Context as fo,createDebugConsoleLogDrain as vo}from"@uniformdev/context";import*as O from"react";var fe="embeddedUniformDevToolsSettings";function dt({context:t,initialSettings:r}){let n=t!=null?t:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0,o=n!=null?n:new fo({manifest:{project:{}}}),[i,a]=O.useState({data:o.storage.data,manifest:o.manifest.data,scores:o.scores,personalizations:[],tests:[]}),[l,p]=O.useState(r!=null?r:{});O.useEffect(()=>{var c;let s=vo((c=l.logLevel)!=null?c:"none");return o.events.on("log",s),()=>{o.events.off("log",s)}},[l,o]),O.useEffect(()=>{let s=()=>{let v=window.localStorage.getItem(fe)||"{}",h=JSON.parse(v),C=ie({quirks:o.storage.data.quirks,quirkOverrides:h.quirkOverrides});C&&(console.log("Applying overridden quirks:",C),o.update({quirks:C}));let w=Z({scores:o.scores,scoreOverrides:h.scoreOverrides});w.length&&(console.log("Applying overridden scores:",w),o.storage.updateData(w)),a(k=>({...k,scores:o.scores,data:o.storage.data,manifest:o.manifest.data}))},c=v=>{!v.changed||a(h=>({...h,personalizations:[...h.personalizations,v]}))},d=v=>{!v.variantAssigned||a(h=>({...h,tests:[...h.tests,v]}))};return o.events.on("personalizationResult",c),o.events.on("testResult",d),o.storage.events.on("*",s),()=>{o.storage.events.off("*",s),o.events.off("personalizationResult",c),o.events.off("testResult",d)}},[o]),O.useEffect(()=>{if(window.localStorage){let s=window.localStorage.getItem(fe);if(s)try{let c=JSON.parse(s),d={...r,...c};p(d);let v=Z({scores:i.scores,scoreOverrides:d.scoreOverrides});m.rawUpdate(v)}catch(c){window.localStorage.removeItem(fe),console.error("Failed to parse settings from localStorage: ",c.message)}}},[]);let{actions:m,saveSettings:u}=O.useMemo(()=>({actions:{update:d=>o.update(d),forget:()=>o.forget(!1),rawUpdate:d=>o.storage.updateData(d)},saveSettings:async d=>{p(d),window.localStorage&&window.localStorage.setItem("embeddedUniformDevToolsSettings",JSON.stringify(d))}}),[o]);return n?e(ct,{state:i,actions:m,settings:l,saveSettings:u}):e("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}import{css as yo}from"@emotion/react";import*as pt from"react";import{css as ho}from"@emotion/react";var bo=ho`
458
+ `},e(fe,{...t}),e("main",{css:ao},e(le,{...t}),s())))}import{Context as co,createDebugConsoleLogDrain as lo}from"@uniformdev/context";import*as x from"react";var me="embeddedUniformDevToolsSettings";function ot({context:t,initialSettings:r}){let n=t!=null?t:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0,o=n!=null?n:new co({manifest:{project:{}}}),[s,a]=x.useState({data:o.storage.data,manifest:o.manifest.data,scores:o.scores,personalizations:[],tests:[]}),[l,p]=x.useState(r!=null?r:{});x.useEffect(()=>{var d;let i=lo((d=l.logLevel)!=null?d:"none");return o.events.on("log",i),()=>{o.events.off("log",i)}},[l,o]),x.useEffect(()=>{let i=()=>{let f=window.localStorage.getItem(me)||"{}",h=JSON.parse(f),C=re({quirks:o.storage.data.quirks,quirkOverrides:h.quirkOverrides});C&&(console.log("Applying overridden quirks:",C),o.update({quirks:C}));let w=N({scores:o.scores,scoreOverrides:h.scoreOverrides});w.length&&(console.log("Applying overridden scores:",w),o.storage.updateData(w)),a(k=>({...k,scores:o.scores,data:o.storage.data,manifest:o.manifest.data}))},d=f=>{!f.changed||a(h=>({...h,personalizations:[...h.personalizations,f]}))},c=f=>{!f.variantAssigned||a(h=>({...h,tests:[...h.tests,f]}))};return o.events.on("personalizationResult",d),o.events.on("testResult",c),o.storage.events.on("*",i),()=>{o.storage.events.off("*",i),o.events.off("personalizationResult",d),o.events.off("testResult",c)}},[o]),x.useEffect(()=>{if(window.localStorage){let i=window.localStorage.getItem(me);if(i)try{let d=JSON.parse(i),c={...r,...d};p(c);let f=N({scores:s.scores,scoreOverrides:c.scoreOverrides});m.rawUpdate(f)}catch(d){window.localStorage.removeItem(me),console.error("Failed to parse settings from localStorage: ",d.message)}}},[]);let{actions:m,saveSettings:u}=x.useMemo(()=>({actions:{update:c=>o.update(c),forget:()=>o.forget(!1),rawUpdate:c=>o.storage.updateData(c)},saveSettings:async c=>{p(c),window.localStorage&&window.localStorage.setItem("embeddedUniformDevToolsSettings",JSON.stringify(c))}}),[o]);return n?e(tt,{state:s,actions:m,settings:l,saveSettings:u}):e("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}import{css as uo}from"@emotion/react";import*as z from"react";import{Theme as go}from"@uniformdev/design-system";import{css as po}from"@emotion/react";var mo=po`
882
459
  align-items: center;
883
460
  border-radius: var(--rounded-full);
884
461
  background: var(--brand-secondary-5);
@@ -904,11 +481,11 @@ summary {
904
481
  max-width: 100%;
905
482
  height: auto;
906
483
  }
907
- `,lt=({...t})=>e("button",{type:"button",css:bo,...t},e("span",{hidden:!0},"Uniform devtools"),e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M13.325 3.05011L8.66741 20.4323L10.5993 20.9499L15.2568 3.56775L13.325 3.05011Z",fill:"currentColor"}),e("path",{d:"M7.61197 18.3608L8.97136 16.9124L8.97086 16.8933L3.87657 12.1121L8.66699 7.00798L7.20868 5.63928L1.04956 12.2017L7.61197 18.3608Z",fill:"currentColor"}),e("path",{d:"M16.388 18.3608L15.0286 16.9124L15.0291 16.8933L20.1234 12.1121L15.333 7.00798L16.7913 5.63928L22.9504 12.2017L16.388 18.3608Z",fill:"currentColor"})));function Li(t){var i;let[r,n]=pt.useState(!1);return((i=t.context)!=null?i:typeof window!="undefined"?window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__:void 0)?e("div",null,e(ae,null),e(lt,{onClick:()=>n(a=>!a)}),r?e("div",{css:yo`
484
+ `,rt=({...t})=>e("button",{type:"button",css:mo,...t},e("span",{hidden:!0},"Uniform devtools"),e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M13.325 3.05011L8.66741 20.4323L10.5993 20.9499L15.2568 3.56775L13.325 3.05011Z",fill:"currentColor"}),e("path",{d:"M7.61197 18.3608L8.97136 16.9124L8.97086 16.8933L3.87657 12.1121L8.66699 7.00798L7.20868 5.63928L1.04956 12.2017L7.61197 18.3608Z",fill:"currentColor"}),e("path",{d:"M16.388 18.3608L15.0286 16.9124L15.0291 16.8933L20.1234 12.1121L15.333 7.00798L16.7913 5.63928L22.9504 12.2017L16.388 18.3608Z",fill:"currentColor"})));function bi(t){let[r,n]=z.useState(!1),[o,s]=z.useState(t.context);return z.useEffect(()=>{!t.context&&typeof document!="undefined"&&s(window.__UNIFORM_DEVTOOLS_CONTEXT_INSTANCE__)},[t.context]),o?e("div",null,e(go,null),e(ie,null),e(rt,{onClick:()=>n(a=>!a)}),r?e("div",{css:uo`
908
485
  box-shadow: var(--shadow-base);
909
486
  position: fixed;
910
487
  bottom: 82px;
911
488
  right: var(--spacing-base);
912
489
  z-index: var(--z-10);
913
490
  max-width: var(--site-width);
914
- `},e(dt,{...t})):null):e("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}export{ct as ContextDevTools,dt as EmbeddedContextDevTools,Li as ToggleEmbeddedContextDevTools};
491
+ `},e(ot,{...t})):null):e("p",null,"Unable to find Uniform Context. Ensure the devtools plugin is activated.")}export{tt as ContextDevTools,ot as EmbeddedContextDevTools,bi as ToggleEmbeddedContextDevTools};