PageSourceSearch

https://docs.addresszen.com/assets/js/bfe60d99.7f2ade5c.js

js addresszen.com collected 2026-09-25 20:18:38 UTC 31,696 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunk_atlas_docs_zen=globalThis.webpackChunk_atlas_docs_zen||[]).push([[4056],{148(e,o,r){r.r(o),r.d(o,{assets:()=>l,contentTitle:()=>d,default:()=>h,frontMatter:()=>s,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"address-lookup/restrict-to-states","title":"Restrict To States","description":"Narrow the states you wish to support.","source":"@site/docs/address-lookup/restrict-to-states.mdx","sourceDirName":"address-lookup","slug":"/address-lookup/restrict-to-states","permalink":"/docs/address-lookup/restrict-to-states","draft":false,"unlisted":false,"tags":[],"version":"current","frontMatter":{"title":"Restrict To States","sidebar_label":"Restrict To States"},"sidebar":"addressfinder","previous":{"title":"Populate a country select","permalink":"/docs/address-lookup/populate-country-select"},"next":{"title":"Restrict To Mainland US","permalink":"/docs/address-lookup/restrict-to-mainland-us"}}');var n=r(5723),a=r(4056),i=r(1571);const s={title:"Restrict To States",sidebar_label:"Restrict To States"},d=void 0,l={},c=[];function p(e){const o={p:"p",...(0,a.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(o.p,{children:"Narrow the states you wish to support."}),"\n",(0,n.jsx)(o.p,{children:"Setting this to an empty array (default) will enable all states."}),"\n",(0,n.jsx)(o.p,{children:"Setting this to a single state will disable suggestions from other states."}),"\n",(0,n.jsx)(i.n,{html:'<form>\n<label for="line_1">Address First Line</label>\n<input type="text" id="line_1" />\n<label for="line_2">Address Second Line</label>\n<input type="text" id="line_2" />\n<label for="city">City</label>\n<input type="text" id="city" />\n<label for="state">State</label>\n<input type="text" id="state" />\n<label for="zipcode">Zip Code</label>\n<input type="text" id="zipcode" />\n</form>',js:'\nimport { AddressLookup } from "@addresszen/address-lookup";\n\nAddressLookup.setup({\n  apiKey: "ak_test",\n  queryOptions: {\n    state: "California",\n  },\n  outputFields: {\n    line_1: "#line_1",\n    line_2: "#line_2",\n    city: "#city",\n    state: "#state",\n    zip_plus_4_code: "#zipcode",\n  },\n});\n'})]})}function h(e={}){const{wrapper:o}={...(0,a.R)(),...e.components};return o?(0,n.jsx)(o,{...e,children:(0,n.jsx)(p,{...e})}):p(e)}},1571(e,o,r){r.d(o,{n:()=>h,u:()=>c});var t=r(4888),n=r(9741),a=r(1850);const i='body {\n  font-family: Poppins, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n  margin: 0;\n  padding: 1.5rem;\n  background-color: #f9fafb;\n  color: #111827;\n  font-size: 14px;\n  line-height: 1.5;\n  display: flex;\n  justify-content: center;\n}\nform {\n  width: 100%;\n  max-width: 24rem;\n  display: flex;\n  flex-direction: column;\n  gap: 0.25rem;\n}\ninput + label { margin-top: 0.5rem; }\nlabel {\n  display: block;\n  font-size: 0.8125rem;\n  font-weight: 500;\n  color: #374151;\n}\ninput, textarea {\n  width: 100%;\n  padding: 0.5rem 0.75rem;\n  font-size: 0.875rem;\n  font-family: inherit;\n  color: #111827;\n  background-color: #ffffff;\n  border: 1px solid #d1d5db;\n  border-radius: 0.375rem;\n  box-sizing: border-box;\n  transition: border-color 150ms ease, box-shadow 150ms ease;\n}\ntextarea { min-height: 5rem; resize: vertical; line-height: 1.5; }\ninput:focus, textarea:focus {\n  outline: none;\n  border-color: #2933e6;\n  box-shadow: 0 0 0 3px rgba(41, 51, 230, 0.15);\n}\n[data-theme="dark"] body { background-color: #1f1f1f; color: #e5e7eb; }\n[data-theme="dark"] label { color: #d1d5db; }\n[data-theme="dark"] input, [data-theme="dark"] textarea {\n  background-color: #2a2a2a;\n  border-color: #444950;\n  color: #e5e7eb;\n}\n[data-theme="dark"] input:focus, [data-theme="dark"] textarea:focus {\n  border-color: #545ceb;\n  box-shadow: 0 0 0 3px rgba(84, 92, 235, 0.25);\n}\n\n/* Postcode Lookup widget default chrome \u2014 matches form input styling.\n   Wrapped in :where() so user-supplied .idpc-* rules always win regardless of\n   load order. */\n:where(.idpc-input) {\n  border-color: #2933e6;\n  box-shadow: 0 0 0 1px rgba(41, 51, 230, 0.1);\n}\n:where(.idpc-input:focus) { border-color: #2933e6; box-shadow: 0 0 0 3px rgba(41, 51, 230, 0.2); }\n:where([data-theme="dark"] .idpc-input) { border-color: #545ceb; box-shadow: 0 0 0 1px rgba(84, 92, 235, 0.15); }\n:where([data-theme="dark"] .idpc-input:focus) { border-color: #545ceb; box-shadow: 0 0 0 3px rgba(84, 92, 235, 0.3); }\n:where(.idpc-button) {\n  margin-top: 0.5rem;\n  padding: 0.5rem 1rem;\n  font-size: 0.875rem;\n  font-weight: 500;\n  color: #ffffff;\n  background-color: #2933e6;\n  border: 1px solid #2933e6;\n  border-radius: 0.375rem;\n  cursor: pointer;\n  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;\n}\n:where(.idpc-button:hover) { background-color: #1f29c4; border-color: #1f29c4; }\n:where(.idpc-button:focus) { outline: none; box-shadow: 0 0 0 3px rgba(41, 51, 230, 0.25); }\n:where(.idpc-select-container) { margin-top: 0.5rem; }\n:where(.idpc-select-container select) {\n  width: 100%;\n  padding: 0.5rem 2.25rem 0.5rem 0.75rem;\n  font-size: 0.875rem;\n  color: #111827;\n  background-color: #ffffff;\n  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 20 20\' fill=\'%236b7280\'%3E%3Cpath fill-rule=\'evenodd\' d=\'M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z\' clip-rule=\'evenodd\'/%3E%3C/svg%3E");\n  background-repeat: no-repeat;\n  background-position: right 0.625rem center;\n  background-size: 1rem;\n  border: 1px solid #d1d5db;\n  border-radius: 0.375rem;\n  box-sizing: border-box;\n  cursor: pointer;\n  appearance: none;\n  -webkit-appearance: none;\n  transition: border-color 150ms ease, box-shadow 150ms ease;\n}\n:where(.idpc-select-container select:focus) {\n  outline: none;\n  border-color: #2933e6;\n  box-shadow: 0 0 0 3px rgba(41, 51, 230, 0.15);\n}\n:where(.idpc-error) { margin-top: 0.5rem; font-size: 0.8125rem; color: #b91c1c; }\n:where(.idpc-unhide) {\n  display: block;\n  width: fit-content;\n  margin-top: 1rem;\n  margin-bottom: 0.5rem;\n  padding: 0.375rem 0.75rem;\n  font-size: 0.8125rem;\n  font-weight: 500;\n  color: #2933e6;\n  background-color: transparent;\n  border: 1px solid #2933e6;\n  border-radius: 0.375rem;\n  cursor: pointer;\n  user-select: none;\n  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;\n}\n:where(.idpc-unhide:hover) { background-color: #2933e6; color: #ffffff; }\n:where(.idpc-unhide:focus) { outline: none; box-shadow: 0 0 0 3px rgba(41, 51, 230, 0.25); }\n:where([data-theme="dark"] .idpc-unhide) { color: #545ceb; border-color: #545ceb; }\n:where([data-theme="dark"] .idpc-unhide:hover) { background-color: #545ceb; color: #ffffff; }\n/* Separate the widget context from address fields that follow it. */\n:where(form >
1 div:has(> .idpc-input)), :where(form > div:has(> .idpc-button)) { margin-bottom: 0.75rem; }\n:where([data-theme="dark"] .idpc-button) { background-color: #545ceb; border-color: #545ceb; }\n:where([data-theme="dark"] .idpc-button:hover) { background-color: #4047d6; border-color: #4047d6; }\n:where([data-theme="dark"] .idpc-select-container select) {\n  background-color: #2a2a2a;\n  border-color: #444950;\n  color: #e5e7eb;\n  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 20 20\' fill=\'%239ca3af\'%3E%3Cpath fill-rule=\'evenodd\' d=\'M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z\' clip-rule=\'evenodd\'/%3E%3C/svg%3E");\n}\n:where([data-theme="dark"] .idpc-select-container select:focus) {\n  border-color: #545ceb;\n  box-shadow: 0 0 0 3px rgba(84, 92, 235, 0.25);\n}\n:where([data-theme="dark"] .idpc-error) { color: #f87171; }\n\n/* Address Finder / Postcode Lookup dropdown \u2014 dark variant.\n   Targets v5.0.4\'s actual selectors (idpc_af is the dropdown wrapper).\n   Once the unreleased beta with --idpc-* variables ships, swap to variable\n   overrides for cleaner theming. */\nhtml[data-theme="dark"] div.idpc_autocomplete {\n  color: #e5e7eb !important;\n}\nhtml[data-theme="dark"] div.idpc_af {\n  background: #2a2a2a !important;\n  border-color: rgba(255, 255, 255, 0.15) !important;\n  box-shadow: 0.05em 0.2em 0.6em rgba(0, 0, 0, 0.6) !important;\n}\nhtml[data-theme="dark"] div.idpc_af > ul > li:hover {\n  background-color: #3a3a3a !important;\n}\nhtml[data-theme="dark"] div.idpc_af > ul > li.idpc_error,\nhtml[data-theme="dark"] div.idpc_af > ul > li.idpc_error:hover {\n  background-color: #2a2a2a !important;\n  color: #9ca3af !important;\n}\nhtml[data-theme="dark"] div.idpc_af > ul > li[aria-selected="true"] {\n  background-color: #545ceb !important;\n  color: #ffffff !important;\n}\nhtml[data-theme="dark"] div.idpc_toolbar {\n  border-top-color: rgba(255, 255, 255, 0.15) !important;\n}\n/* Country toggle: source CSS sets hover bg to #e5e4e2 (light grey) which\n   reads as bright white-on-white in dark mode. Tone it down and ensure the\n   country-name text stays legible when it expands on hover. */\nhtml[data-theme="dark"] div.idpc_autocomplete > div > div > span:hover {\n  background-color: #3a3a3a !important;\n}\nhtml[data-theme="dark"] div.idpc_toolbar > span span.idpc_country {\n  color: #e5e7eb !important;\n}';var s=r(5723);const d={border:"1px solid var(--ifm-color-emphasis-300)",borderRadius:"var(--ifm-card-border-radius)",backgroundColor:"var(--ifm-background-surface-color)"},l=(e={})=>{const{imports:o={},mode:r="simple",themeColor:t,editor:l,editorTheme:c,fontFamily:p,baseCss:h=i}=e;return function({html:e,js:i,css:u,scripts:m,stylesheets:f,head:b,baseCss:g=h,imports:w,height:v="500px",view:y="split",mode:k=r,loading:x="lazy",activeEditor:C,className:j,style:_,editorTheme:S=c,theme:z="light"}){const E="dark"===z;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.A,{fallback:(0,s.jsx)("div",{style:{height:v},children:"Loading..."}),children:()=>{const r=[g&&`<style>${g}</style>`,b].filter(Boolean).join("\n");return(0,s.jsx)(a.A,{height:v,loading:x,className:j,style:{...d,..._},config:{mode:k,view:y,theme:E?"dark":"light",htmlAttrs:{"data-theme":E?"dark":"light"},markup:{language:"html",content:e},...i&&{script:{language:"javascript",content:i}},...u&&{style:{language:"css",content:u}},languages:[...i?["javascript"]:[],"html",...u?["css"]:[]],activeEditor:C??(i?"script":"markup"),lineNumbers:!1,wordWrap:!0,useTabs:!1,tabSize:2,...m&&{scripts:m},...f&&{stylesheets:f},...r&&{head:r},imports:{...o,...w},...S&&{editorTheme:S},...t&&{themeColor:E?t.dark:t.light},...l&&{editor:l},...p&&{fontFamily:p}}})}}),(0,s.jsxs)("div",{style:{display:"none"},"aria-hidden":"true",children:[(0,s.jsx)("pre",{children:e}),i&&(0,s.jsx)("pre",{children:i}),u&&(0,s.jsx)("pre",{children:u})]})]})}},c=(l(),'@import url("https://fonts.googleapis.com/css2?family=Hanken+Grotesk:wght@400;500;600&display=swap");\nbody {\n  font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;\n  margin: 0;\n  padding: 1.5rem;\n  background-color: #f5efe2;\n  color: #1d1a17;\n  font-size: 14px;\n  line-height: 1.5;\n  display: flex;\n  justify-content: center;\n}\nform {\n  width: 100%;\n  max-width: 24rem;\n  display: flex;\n  flex-direction: column;\n  gap: 0.25rem;\n}\ninput + label { margin-top: 0.5rem; }\nlabel {\n  display: block;\n  font-size: 0.8125rem;\n  font-weight: 500;\n  color: #5f5a50;\n}\ninput, textarea {\n  width: 100%;\n  padding: 0.5rem 0.75rem;\n  font-size: 0.875rem;\n  font-family: inherit;\n  color: #1d1a17;\n  background-color: #fbf7ee;\n  border: 1px solid rgba(29, 26, 23, 0.18);\n  border-radius: 8px;\n  box-sizing: border-box;\n  transition: border-color 150ms ease, box-shadow 150ms ease;\n}\ntextarea { min-height: 5rem; resize: vertical; line-height: 1.5; }\ninput:focus, textarea:focus {\n  outline: none;\n  border-color: #c13b2a;\n  box-shadow: 0 0 0 3px rgba(193, 59, 42, 0.16);\n}\n[data-theme="dark"] body { background-color: #1d1a17; color: #f7f2e9; }\n[data-theme="dark"] label { color: #a8a093; }\n[data-theme="dark"] input, [data-theme="dark"] textarea {\n  background-color: #262220;\n  border-color: rgba(247, 242, 233, 0.16);\n  color: #f7f2e9;\n}\n[data-theme="dark"] input:focus, [data-theme="dark"] textarea:focus {\n  border-color: #e
10a196;\n  box-shadow: 0 0 0 3px rgba(224, 161, 150, 0.25);\n}\n\n/* Widget default chrome \u2014 matches the form inputs. Wrapped in :where() so\n   user-supplied .idpc-* rules always win regardless of load order. */\n:where(.idpc-input) {\n  border-color: #c13b2a;\n  box-shadow: 0 0 0 1px rgba(193, 59, 42, 0.1);\n}\n:where(.idpc-input:focus) { border-color: #c13b2a; box-shadow: 0 0 0 3px rgba(193, 59, 42, 0.2); }\n:where([data-theme="dark"] .idpc-input) { border-color: #e0a196; box-shadow: 0 0 0 1px rgba(224, 161, 150, 0.15); }\n:where([data-theme="dark"] .idpc-input:focus) { border-color: #e0a196; box-shadow: 0 0 0 3px rgba(224, 161, 150, 0.3); }\n:where(.idpc-button) {\n  margin-top: 0.5rem;\n  padding: 0.5rem 1rem;\n  font-size: 0.875rem;\n  font-weight: 500;\n  color: #f5efe2;\n  background-color: #c13b2a;\n  border: 1px solid #c13b2a;\n  border-radius: 100px;\n  cursor: pointer;\n  transition: background-color 150ms ease, border-color 150ms ease, box-shadow 150ms ease;\n}\n:where(.idpc-button:hover) { background-color: #a83224; border-color: #a83224; }\n:where(.idpc-button:focus) { outline: none; box-shadow: 0 0 0 3px rgba(193, 59, 42, 0.25); }\n:where(.idpc-select-container) { margin-top: 0.5rem; }\n:where(.idpc-select-container select) {\n  width: 100%;\n  padding: 0.5rem 2.25rem 0.5rem 0.75rem;\n  font-size: 0.875rem;\n  color: #1d1a17;\n  background-color: #fbf7ee;\n  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 20 20\' fill=\'%238a8375\'%3E%3Cpath fill-rule=\'evenodd\' d=\'M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z\' clip-rule=\'evenodd\'/%3E%3C/svg%3E");\n  background-repeat: no-repeat;\n  background-position: right 0.625rem center;\n  background-size: 1rem;\n  border: 1px solid rgba(29, 26, 23, 0.18);\n  border-radius: 8px;\n  box-sizing: border-box;\n  cursor: pointer;\n  appearance: none;\n  -webkit-appearance: none;\n  transition: border-color 150ms ease, box-shadow 150ms ease;\n}\n:where(.idpc-select-container select:focus) {\n  outline: none;\n  border-color: #c13b2a;\n  box-shadow: 0 0 0 3px rgba(193, 59, 42, 0.16);\n}\n:where(.idpc-error) { margin-top: 0.5rem; font-size: 0.8125rem; color: #a83224; }\n:where(.idpc-unhide) {\n  display: block;\n  width: fit-content;\n  margin-top: 1rem;\n  margin-bottom: 0.5rem;\n  padding: 0.375rem 0.75rem;\n  font-size: 0.8125rem;\n  font-weight: 500;\n  color: #c13b2a;\n  background-color: transparent;\n  border: 1px solid #c13b2a;\n  border-radius: 100px;\n  cursor: pointer;\n  user-select: none;\n  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;\n}\n:where(.idpc-unhide:hover) { background-color: #c13b2a; color: #f5efe2; }\n:where(.idpc-unhide:focus) { outline: none; box-shadow: 0 0 0 3px rgba(193, 59, 42, 0.25); }\n:where([data-theme="dark"] .idpc-unhide) { color: #e0a196; border-color: #e0a196; }\n:where([data-theme="dark"] .idpc-unhide:hover) { background-color: #e0a196; color: #1d1a17; }\n/* Separate the widget context from address fields that follow it. */\n:where(form > div:has(> .idpc-input)), :where(form > div:has(> .idpc-button)) { margin-bottom: 0.75rem; }\n:where([data-theme="dark"] .idpc-button) { background-color: #e0a196; border-color: #e0a196; color: #1d1a17; }\n:where([data-theme="dark"] .idpc-button:hover) { background-color: #d48b7e; border-color: #d48b7e; }\n:where([data-theme="dark"] .idpc-select-container select) {\n  background-color: #262220;\n  border-color: rgba(247, 242, 233, 0.16);\n  color: #f7f2e9;\n  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 20 20\' fill=\'%23a8a093\'%3E%3Cpath fill-rule=\'evenodd\' d=\'M5.23 7.21a.75.75 0 011.06.02L10 11.06l3.71-3.83a.75.75 0 111.08 1.04l-4.25 4.39a.75.75 0 01-1.08 0L5.21 8.27a.75.75 0 01.02-1.06z\' clip-rule=\'evenodd\'/%3E%3C/svg%3E");\n}\n:where([data-theme="dark"] .idpc-select-container select:focus) {\n  border-color: #e0a196;\n  box-shadow: 0 0 0 3px rgba(224, 161, 150, 0.25);\n}
1\n:where([data-theme="dark"] .idpc-error) { color: #e0a196; }\n\n/* Address Lookup dropdown \u2014 dark variant. Targets the widget\'s own selectors\n   (idpc_af is the dropdown wrapper). */\nhtml[data-theme="dark"] div.idpc_autocomplete {\n  color: #f7f2e9 !important;\n}\nhtml[data-theme="dark"] div.idpc_af {\n  background: #262220 !important;\n  border-color: rgba(247, 242, 233, 0.16) !important;\n  box-shadow: 0.05em 0.2em 0.6em rgba(0, 0, 0, 0.6) !important;\n}\nhtml[data-theme="dark"] div.idpc_af > ul > li:hover {\n  background-color: #33302b !important;\n}\nhtml[data-theme="dark"] div.idpc_af > ul > li.idpc_error,\nhtml[data-theme="dark"] div.idpc_af > ul > li.idpc_error:hover {\n  background-color: #262220 !important;\n  color: #a8a093 !important;\n}\nhtml[data-theme="dark"] div.idpc_af > ul > li[aria-selected="true"] {\n  background-color: #e0a196 !important;\n  color: #1d1a17 !important;\n}\nhtml[data-theme="dark"] div.idpc_toolbar {\n  border-top-color: rgba(247, 242, 233, 0.16) !important;\n}\nhtml[data-theme="dark"] div.idpc_autocomplete > div > div > span:hover {\n  background-color: #33302b !important;\n}\nhtml[data-theme="dark"] div.idpc_toolbar > span span.idpc_country {\n  color: #f7f2e9 !important;\n}'),p=l({mode:"focus",imports:{"@addresszen/address-lookup":"https://esm.sh/@addresszen/address-lookup@2"},themeColor:{light:"hsl(40, 10%, 55%)",dark:"hsl(40, 12%, 50%)"},editorTheme:["solarized-light@light","gruvbox-dark@dark"],fontFamily:"IBM Plex Mono",baseCss:c});function h(e){const{isDarkTheme:o}=(0,t.G)();return(0,s.jsx)(p,{...e,theme:o?"dark":"light"})}},1850(e,o,r){r.d(o,{A:()=>b});var t,n,a=r(2155),i=r(5723),s=Object.create,d=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=Object.getOwnPropertyNames,p=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,u=(t=(e,o)=>{var r=function(){var e=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",t={};function n(e,o){if(!t[e]){t[e]={};for(var r=0;r<e.length;r++)t[e][e.charAt(r)]=r}return t[e][o]}var a={compressToBase64:function(e){if(null==e)return"";var r=a._compress(e,6,function(e){return o.charAt(e)});switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(e){return null==e?"":""==e?null:a._decompress(e.length,32,function(r){return n(o,e.charAt(r))})},compressToUTF16:function(o){return null==o?"":a._compress(o,15,function(o){return e(o+32)})+" "},decompressFromUTF16:function(e){return null==e?"":""==e?null:a._decompress(e.length,16384,function(o){return e.charCodeAt(o)-32})},compressToUint8Array:function(e){for(var o=a.compress(e),r=new Uint8Array(2*o.length),t=0,n=o.length;t<n;t++){var i=o.charCodeAt(t);r[2*t]=i>>>8,r[2*t+1]=i%256}return r},decompressFromUint8Array:function(o){if(null==o)return a.decompress(o);for(var r=new Array(o.length/2),t=0,n=r.length;t<n;t++)r[t]=256*o[2*t]+o[2*t+1];var i=[];return r.forEach(function(o){i.push(e(o))}),a.decompress(i.join(""))},compressToEncodedURIComponent:function(e){return null==e?"":a._compress(e,6,function(e){return r.charAt(e)})},decompressFromEncodedURIComponent:function(e){return null==e?"":""==e?null:(e=e.replace(/ /g,"+"),a._decompress(e.length,32,function(o){return n(r,e.charAt(o))}))},compress:function(o){return a._compress(o,16,function(o){return e(o)})},_compress:function(e,o,r){if(null==e)return"";var t,n,a,i={},s={},d="",l="",c="",p=2,h=3,u=2,m=[],f=0,b=0;for(a=0;a<e.length;a+=1)if(d=e.charAt(a),Object.prototype.hasOwnProperty.call(i,d)||(i[d]=h++,s[d]=!0),l=c+d,Object.prototype.hasOwnProperty.call(i,l))c=l;else{if(Object.prototype.hasOwnProperty.call(s,c)){if(c.charCodeAt(0)<256){for(t=0;t<u;t++)f<<=1,b==o-1?(b=0,m.push(r(f)),f=0):b++;for(n=c.charCodeAt(0),t=0;t<8;t++)f=f<<1|1&n,b==o-1?(b=0,m.push(r(f)),f=0):b++,n>>=1}else{for(n=1,t=0;t<u;t++)f=f<<1|n,b==o-1?(b=0,m.push(r(f)),f=0):b++,n=0;for(n=c.charCodeAt(0),t=0;t<16;t++)f=f<<1|1&n,b==o-1?(b=0,m.push(r(f)),f=0):b++,n>>=1}0==--p&&(p=Math.pow(2,u),u++),delete s[c]}else for(n=i[c],t=0;t<u;t++)f=f<<1|1&n,b==o-1?(b=0,m.push(r(f)),f=0):b++,n>>=1;0==--p&&(p=Math.pow(2,u),u++),i[l]=h++,c=String(d)}if(""!==c){if(Object.prototype.hasOwnProperty.call(s,c)){if(c.charCodeAt(0)<256){for(t=0;t<u;t++)f<<=1,b==o-1?(b=0,m.push(r(f)),f=0):b++;for(n=c.charCodeAt(0),t=0;t<8;t++)f=f<<1|1&n,b==o-1?(b=0,m.push(r(f)),f=0):b++,n>>=1}else{for(n=1,t=0;t<u;
1t++)f=f<<1|n,b==o-1?(b=0,m.push(r(f)),f=0):b++,n=0;for(n=c.charCodeAt(0),t=0;t<16;t++)f=f<<1|1&n,b==o-1?(b=0,m.push(r(f)),f=0):b++,n>>=1}0==--p&&(p=Math.pow(2,u),u++),delete s[c]}else for(n=i[c],t=0;t<u;t++)f=f<<1|1&n,b==o-1?(b=0,m.push(r(f)),f=0):b++,n>>=1;0==--p&&(p=Math.pow(2,u),u++)}for(n=2,t=0;t<u;t++)f=f<<1|1&n,b==o-1?(b=0,m.push(r(f)),f=0):b++,n>>=1;for(;;){if(f<<=1,b==o-1){m.push(r(f));break}b++}return m.join("")},decompress:function(e){return null==e?"":""==e?null:a._decompress(e.length,32768,function(o){return e.charCodeAt(o)})},_decompress:function(o,r,t){var n,a,i,s,d,l,c,p=[],h=4,u=4,m=3,f="",b=[],g={val:t(0),position:r,index:1};for(n=0;n<3;n+=1)p[n]=n;for(i=0,d=Math.pow(2,2),l=1;l!=d;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=t(g.index++)),i|=(s>0?1:0)*l,l<<=1;switch(i){case 0:for(i=0,d=Math.pow(2,8),l=1;l!=d;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=t(g.index++)),i|=(s>0?1:0)*l,l<<=1;c=e(i);break;case 1:for(i=0,d=Math.pow(2,16),l=1;l!=d;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=t(g.index++)),i|=(s>0?1:0)*l,l<<=1;c=e(i);break;case 2:return""}for(p[3]=c,a=c,b.push(c);;){if(g.index>o)return"";for(i=0,d=Math.pow(2,m),l=1;l!=d;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=t(g.index++)),i|=(s>0?1:0)*l,l<<=1;switch(c=i){case 0:for(i=0,d=Math.pow(2,8),l=1;l!=d;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=t(g.index++)),i|=(s>0?1:0)*l,l<<=1;p[u++]=e(i),c=u-1,h--;break;case 1:for(i=0,d=Math.pow(2,16),l=1;l!=d;)s=g.val&g.position,g.position>>=1,0==g.position&&(g.position=r,g.val=t(g.index++)),i|=(s>0?1:0)*l,l<<=1;p[u++]=e(i),c=u-1,h--;break;case 2:return b.join("")}if(0==h&&(h=Math.pow(2,m),m++),p[c])f=p[c];else{if(c!==u)return null;f=a+a.charAt(0)}b.push(f),p[u++]=a+f.charAt(0),a=f,0==--h&&(h=Math.pow(2,m),m++)}}};return a}();void 0!==o&&null!=o&&(o.exports=r)},()=>(n||t((n={exports:{}}).exports,n),n.exports)),m=((e,o,r)=>(r=null!=e?s(p(e)):{},((e,o,r,t)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let n of c(o))!h.call(e,n)&&n!==r&&d(e,n,{get:()=>o[n],enumerable:!(t=l(o,n))||t.enumerable});return e})(!o&&e&&e.__esModule?r:d(r,"default",{value:e,enumerable:!0}),e)))(u());async function f(e,o={}){"object"==typeof e&&!(e instanceof HTMLElement)&&(e.headless||"headless"===e.view)&&(o=e,e=null);let{config:r={},headless:t,loading:n="lazy",view:a}=o,i=t||"headless"===a,s=null,d=null;if("string"==typeof e)s=document.querySelector(e);else if(e instanceof HTMLElement)s=e;else if(!i||"object"!=typeof e)throw new Error("A valid container element is required.");if(!s){if(!i)throw new Error(`Cannot find element: "${e}"`);s=document.createElement("div"),_(s),document.body.appendChild(s)}let l=new URL(function(e={}){let o,{appUrl:r="https://livecodes.io",params:t={},config:n={},headless:a,import:i,lite:s,view:d,...l}=e;try{o=new URL(r)}catch(h){throw new Error(`${r} is not a valid URL.`)}let c=new URLSearchParams;Object.entries(l).forEach(([e,r])=>{void 0!==r&&o.searchParams.set(e,String(r))});let p="headless"===e.view||a;if(s&&(console.warn('Deprecation notice: "lite" option is deprecated. Use "config: { mode: \'lite\' }" instead.'),"object"==typeof n&&null==n.mode?n.mode="lite":o.searchParams.set("lite","true")),d&&(console.warn('Deprecation notice: The "view" option has been moved to "config.view". For headless mode use "headless: true".'),"object"==typeof n&&null==n.view&&"headless"!==d?n.view=d:o.searchParams.set("view",d)),"string"==typeof n)try{new URL(n),o.searchParams.set("config",encodeURIComponent(n))}catch(h){throw new Error('"config" is not a valid URL or configuration object.')}else n&&"object"==typeof n&&Object.keys(n).length>0&&(n.title&&"Untitled Project"!==n.title&&o.searchParams.set("title",n.title),n.description&&n.description.length>0&&o.searchParams.set("description",n.description),c.set("config","code/"+(0,m.compressToEncodedURIComponent)(JSON.stringify(n))));if(t&&"object"==typeof t&&Object.keys(t).length>0)try{c.set("params",(0,m.compressToEncodedURIComponent)(JSON.stringify(t)))}
1catch(h){Object.keys(t).forEach(e=>{o.searchParams.set(e,encodeURIComponent(String(t[e])))})}return i&&o.searchParams.set("x",encodeURIComponent(i)),p&&o.searchParams.set("headless","true"),c.toString().length>0&&(o.hash=c.toString()),o.href}(o)),c=l.origin;l.searchParams.set("embed","true"),l.searchParams.set("loading",i?"eager":n),l.searchParams.set("sdkVersion","0.13.0"),"object"==typeof r&&Object.keys(r).length>0&&l.searchParams.set("config","sdk");let p=o.params;"object"==typeof p&&Object.keys(p).length>0&&JSON.stringify(p).length<1800&&Object.keys(p).forEach(e=>{l.searchParams.set(e,encodeURIComponent(String(p[e])))});let h=!1,u="Cannot call API methods after calling `destroy()`.",f=[],b=(e,o="message")=>{addEventListener(o,e),f.push(e)},g=await new Promise(e=>{var o,t,a,p,h,u,m,f,g;if(!s)return;let w=s.dataset.height||s.style.height;if(w&&!i){let e=isNaN(Number(w))?w:w+"px";s.style.height=e}"false"!==s.dataset.defaultStyles&&!i&&((o=s.style).backgroundColor||(o.backgroundColor="#fff"),(t=s.style).border||(t.border="1px solid black"),(a=s.style).borderRadius||(a.borderRadius="8px"),(p=s.style).boxSizing||(p.boxSizing="border-box"),(h=s.style).padding||(h.padding="0"),(u=s.style).width||(u.width="100%"),(m=s.style).height||(m.height=s.style.height||"300px"),s.style.minHeight="200px",s.style.flexGrow="1",(f=s.style).overflow||(f.overflow="hidden"),(g=s.style).resize||(g.resize="vertical"));let v="livecodes",y=s.querySelector(`iframe.${v}`),k=y||document.createElement("iframe");k.classList.add(v),k.setAttribute("allow","accelerometer; camera; encrypted-media; display-capture; geolocation; gyroscope; microphone; midi; clipboard-read; clipboard-write; web-share"),k.setAttribute("allowtransparency","true"),k.setAttribute("allowpaymentrequest","true"),k.setAttribute("allowfullscreen","true"),k.setAttribute("sandbox","allow-same-origin allow-downloads allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-presentation allow-scripts");let x="eager"===n?"eager":"lazy";k.setAttribute("loading",x),i?_(k):(k.style.height="100%",k.style.minHeight="200px",k.style.width="100%",k.style.margin="0",k.style.border="0",k.style.borderRadius=s.style.borderRadius),b(function e(o){var r;o.source!==k.contentWindow||o.origin!==c||"livecodes-init"!==(null==(r=o.data)?void 0:r.type)||(removeEventListener("message",e),d=Number(o.data.payload.appVersion.replace(/^v/,"")))}),(!d||d<46)&&b(function e(o){var t,n;o.source!==k.contentWindow||o.origin!==c||"livecodes-get-config"!==(null==(t=o.data)?void 0:t.type)||(removeEventListener("message",e),null==(n=k.contentWindow)||n.postMessage({type:"livecodes-config",payload:r},c))}),k.onload=()=>{e(k)},k.src=l.href,y||s.appendChild(k)}),w=new Promise(e=>{b(function o(r){var t;r.source!==g.contentWindow||r.origin!==c||"livecodes-ready"!==(null==(t=r.data)?void 0:t.type)||(removeEventListener("message",o),e(),w.settled=!0)})}),v=()=>h?Promise.reject(u):new Promise(async e=>{var o;w.settled&&e();null==(o=g.contentWindow)||o.postMessage({type:"livecodes-load"},c),await w,e()}),y=(e,o)=>new Promise(async(r,t)=>{var n;if(h)return t(u);await v();let a=S();b(function o(n){var i,s;if(n.source===g.contentWindow&&n.origin===c&&"livecodes-api-response"===(null==(i=n.data)?void 0:i.type)&&(null==(s=n.data)?void 0:s.id)===a&&n.data.method===e){removeEventListener("message",o);let e=n.data.payload;null!=e&&e.error?t(e.error):r(e)}}),null==(n=g.contentWindow)||n.postMessage({method:e,id:a,args:o},c)}),k={},x=["load","ready","code","console","tests","destroy"],C=(e,o)=>{var r;if(h)throw new Error(u);return x.includes(e)?(y("watch",[e]),k[e]||(k[e]=[]),null==(r=k[e])||r.push(o),{remove:()=>{var r,t;k[e]=null==(r=k[e])?void 0:r.filter(e=>e!==o),0===(null==(t=k[e])?void 0:t.length)&&y("watch",[e,"unsubscribe"])}}):{remove:()=>{}}};b(async function(e){var o,r,t,n;let a={"livecodes-app-loaded":"load","livecodes-ready":"ready","livecodes-change":"code","livecodes-console":"console","livecodes-test-results":"tests","livecodes-destroy":"destroy"}[null!=(r=null==(o=e.data)?void 0:o.type)?r:""];if(e.source!==g.contentWindow||e.origin!==c||!a||!k[a])return;let i=null==(t=e.data)?void 0:t.payload;
1null==(n=k[a])||n.forEach(e=>{e(i)})});let j;function _(e){e.style.position="absolute",e.style.top="0",e.style.visibility="hidden",e.style.opacity="0"}"lazy"===n&&"IntersectionObserver"in window&&(j=new IntersectionObserver((e,o)=>{e.forEach(async e=>{e.isIntersecting&&(await v(),o.unobserve(s))})},{rootMargin:"150px"}),j.observe(s));let S=()=>(String(Math.random())+Date.now().toFixed()).replace("0.","");return{load:()=>v(),run:()=>y("run"),format:e=>y("format",[e]),getShareUrl:e=>y("getShareUrl",[e]),getConfig:e=>y("getConfig",[e]),setConfig:e=>y("setConfig",[e]),getCode:()=>y("getCode"),show:(e,o)=>y("show",[e,o]),runTests:()=>y("runTests"),onChange:e=>C("code",e),watch:C,exec:(e,...o)=>y("exec",[e,...o]),destroy:()=>{return h?Promise.reject(u):(null==(e=null==g?void 0:g.remove)||e.call(g),Object.values(k).forEach(e=>{e.length=0}),f.forEach(e=>removeEventListener("message",e)),f.length=0,j&&s&&j.unobserve(s),h=!0,Promise.resolve());var e}}}function b(e){let o=(0,a.useRef)(null),[r,t]=(0,a.useState)(e.className||""),[n,s]=(0,a.useState)(e.style||{}),[d,l]=(0,a.useState)(e.height),[c,p]=(0,a.useState)(),[h,u]=(0,a.useState)(JSON.stringify(e.config||"")),[m,b]=(0,a.useState)("");return(0,a.useEffect)(()=>{if(!o.current)return;let{className:r,style:n,height:a,sdkReady:i,config:d,...g}=e;if(t(r||""),s(n||{}),l(a),c&&m===JSON.stringify(g)){if(h===JSON.stringify(d))return;u(JSON.stringify(d)),"string"==typeof d?fetch(d).then(e=>e.json()).then(e=>{null==c||c.setConfig(e)}):d&&c.setConfig(d)}else b(JSON.stringify(g)),null==c||c.destroy(),f(o.current,{config:d,...g}).then(e=>{p(e),"function"==typeof i&&i(e)})},[e]),(0,a.useEffect)(()=>()=>{null==c||c.destroy()},[]),(0,i.jsx)("div",{ref:o,className:r,style:n,"data-height":d})}},4056(e,o,r){r.d(o,{R:()=>i,x:()=>s});var t=r(2155);const n={},a=t.createContext(n);function i(e){const o=t.useContext(a);return t.useMemo(function(){return"function"==typeof e?e(o):{...o,...e}},[o,e])}function s(e){let o;return o=e.disableParentContext?"function"==typeof e.components?e.components(n):e.components||n:i(e.components),t.createElement(a.Provider,{value:o},e.children)}},9741(e,o,r){r.d(o,{A:()=>a});r(2155);var t=r(1950),n=r(5723);function a({children:e,fallback:o}){return(0,t.A)()?(0,n.jsx)(n.Fragment,{children:e?.()}):o??null}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.