proto-autos-wc 0.0.965 → 0.0.967
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.
- package/dist/cjs/proto-autos.cjs.entry.js +1 -1
- package/dist/collection/utils/tw-version.js +1 -1
- package/dist/esm/proto-autos.entry.js +1 -1
- package/dist/proto-autos-wc/{p-f74ffa59.entry.js → p-2d301e50.entry.js} +1 -1
- package/dist/proto-autos-wc/proto-autos-wc.esm.js +1 -1
- package/dist/types/utils/tw-version.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e,f as r,h as t,r as o}from"./p-d092c4aa.js";const n="proto-autos",i="data",a="pick",l=e=>{const r=localStorage.getItem(e?`${n}-${e}`:n);return r?JSON.parse(r):void 0},s=(e,r)=>{const t=e?`${n}-${e}`:n,o=JSON.stringify(r);localStorage.setItem(t,o)},c=e=>!("isConnected"in e)||e.isConnected,d=(()=>{let e;return(...r)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let r of e.keys())e.set(r,e.get(r).filter(c))})(...r)}),2e3)}})(),u=e=>"function"==typeof e?e():e;var f=function(){function e(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(r,t,o){return t&&e(r.prototype,t),o&&e(r,o),r}}();function b(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}var p=function(){function e(){var r=this;b(this,e),this.interceptors=[],this.fetch=function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.interceptorWrapper.apply(r,[fetch].concat(t))}}return f(e,[{key:"addInterceptors",value:function(e){var r=this,t=[];return Array.isArray(e)?e.map((function(e){return t.push(r.interceptors.length),r.interceptors.push(e)})):e instanceof Object&&(t.push(this.interceptors.length),this.interceptors.push(e)),this.updateInterceptors(),function(){return r.removeInterceptors(t)}}},{key:"removeInterceptors",value:function(e){var r=this;Array.isArray(e)&&(e.map((function(e){return r.interceptors.splice(e,1)})),this.updateInterceptors())}},{key:"updateInterceptors",value:function(){this.reversedInterceptors=this.interceptors.reduce((function(e,r){return[r].concat(e)}),[])}},{key:"clearInterceptors",value:function(){this.interceptors=[],this.updateInterceptors()}},{key:"interceptorWrapper",value:function(e){for(var r=arguments.length,t=Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];var n=Promise.resolve(t);return this.reversedInterceptors.forEach((function(e){var r=e.request,o=e.requestError;(r||o)&&(n=n.then((function(){return r.apply(void 0,t)}),o))})),n=n.then((function(){return e.apply(void 0,t)})),this.reversedInterceptors.forEach((function(e){var r=e.response,t=e.responseError;(r||t)&&(n=n.then(r,t))})),n}}]),e}(),m=function(){function e(r){var t=r.url,o=r.interceptors,n=r.headers,i=r.onStart,a=r.onEnd,l=r.omitEmptyVariables,s=void 0!==l&&l,c=r.requestOptions,d=void 0===c?{}:c;b(this,e);var u=function(e,r){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!r||"object"!=typeof r&&"function"!=typeof r?e:r}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return u.requestObject=Object.assign({},{method:"POST",headers:Object.assign({},{Accept:"application/json","Content-Type":"application/json"},n),credentials:"same-origin"},d),u.url=t,u.omitEmptyVariables=s,u.requestQueueLength=0,u.EnumMap={},u.callbacks={onStart:i,onEnd:a},u.addInterceptors(o),u}return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)}(e,p),f(e,[{key:"query",value:function(e){var r,t=this,o=e.operationName,n=e.query,i=e.variables,a=e.opts,l=void 0===a?{}:a,s=e.requestOptions,c=Object.assign({},this.requestObject,void 0===s?{}:s);return r=this.omitEmptyVariables||l.omitEmptyVariables?this.doOmitEmptyVariables(i):i,c.body=JSON.stringify({operationName:o,query:n,variables:r}),this.onStart(),this.fetch(this.url,c).then((function(e){return e.ok?e.json():{errors:[{message:e.statusText,stack:e}]}})).then((function(e){var r=e.data,o=e.errors;return new Promise((function(e,n){return t.onEnd(),r?Object.keys(r).every((function(e){return!r[e]}))?n(o):e({data:r,errors:o}):n(o||[{}])}))}))}},{key:"getUrl",value:function(){return this.url}},{key:"setUrl",value:function(e){this.url=e}},{key:"getEnumTypes",value:function(e){var r=this,t={},o=e.filter((function(e){return!r.EnumMap[e]||(t[e]=r.EnumMap[e],!1)}));if(!o.length)return new Promise((function(e){e({data:t})}));var n="\n query {\n "+o.map((function(e){return e+': __type(name: "'+e+'") {\n ...EnumFragment\n }'})).join("\n")+"\n }\n \n fragment EnumFragment on __Type {\n kind\n description\n enumValues {\n name\n description\n }\n }",i=Object.assign({},this.requestObject);return i.body=JSON.stringify({query:n}),this.onStart(),this.fetch(this.url,i).then((function(e){return e.ok?e.json():{errors:[{message:e.statusText,stack:e}]}})).then((function(e){var o=e.data,n=e.errors;return new Promise((function(e,i){if(r.onEnd(),!o)return i(n||[{message:"Do not get any data."}]);if(Object.keys(o).every((function(e){return!o[e]}))&&n&&n.length)return i(n);var a=Object.assign(t,o);return Object.keys(o).map((function(e){return r.EnumMap[e]=o[e],e})),e({data:a,errors:n})}))}))}},{key:"onStart",value:function(){this.requestQueueLength++,this.requestQueueLength>1||!this.callbacks.onStart||this.callbacks.onStart(this.requestQueueLength)}},{key:"onEnd",value:function(){this.requestQueueLength--,!this.requestQueueLength&&this.callbacks.onEnd&&this.callbacks.onEnd(this.requestQueueLength)}},{key:"doOmitEmptyVariables",value:function(e){var r=this,t={};return Object.keys(e).map((function(o){var n=e[o];return"string"==typeof n&&0===n.length||null==n||(t[o]=n instanceof Object?r.doOmitEmptyVariables(n):n),o})),t}}]),e}();const g={loading:!1,error:void 0,data:void 0,pick:0,dealer:void 0},{state:h}=(()=>{const t=((e,r=((e,r)=>e!==r))=>{const t=u(e);let o=new Map(Object.entries(null!=t?t:{}));const n={dispose:[],get:[],set:[],reset:[]},i=()=>{var r;o=new Map(Object.entries(null!==(r=u(e))&&void 0!==r?r:{})),n.reset.forEach((e=>e()))},a=e=>(n.get.forEach((r=>r(e))),o.get(e)),l=(e,t)=>{const i=o.get(e);r(t,i,e)&&(o.set(e,t),n.set.forEach((r=>r(e,t,i))))},s="undefined"==typeof Proxy?{}:new Proxy(t,{get:(e,r)=>a(r),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,r)=>o.has(r),set:(e,r,t)=>(l(r,t),!0)}),c=(e,r)=>(n[e].push(r),()=>{((e,r)=>{const t=e.indexOf(r);t>=0&&(e[t]=e[e.length-1],e.length--)})(n[e],r)});return{state:s,get:a,set:l,on:c,onChange:(r,t)=>{const o=c("set",((e,o)=>{e===r&&t(o)})),n=c("reset",(()=>t(u(e)[r])));return()=>{o(),n()}},use:(...e)=>{const r=e.reduce(((e,r)=>(r.set&&e.push(c("set",r.set)),r.get&&e.push(c("get",r.get)),r.reset&&e.push(c("reset",r.reset)),r.dispose&&e.push(c("dispose",r.dispose)),e)),[]);return()=>r.forEach((e=>e()))},dispose:()=>{n.dispose.forEach((e=>e())),i()},reset:i,forceUpdate:e=>{const r=o.get(e);n.set.forEach((t=>t(e,r,r)))}}})(g,void 0);return t.use((()=>{if("function"!=typeof e)return{};const t=new Map;return{dispose:()=>t.clear(),get:r=>{const o=e();o&&((e,r,t)=>{const o=e.get(r);o?o.includes(t)||o.push(t):e.set(r,[t])})(t,r,o)},set:e=>{const o=t.get(e);o&&t.set(e,o.filter(r)),d(t)},reset:()=>{t.forEach((e=>e.forEach(r))),d(t)}}})()),t})(),w=(e=!1)=>{h.loading=e,h.error=void 0,h.pick=0,h.data=void 0,h.dealer=void 0},v=e=>{if(e){const{pick:r}=h;h.dealer=null!=r?e.list[r]:void 0,h.data=e,h.loading=!1}else h.data=void 0,h.loading=!1},y=e=>{const{data:r}=h;r&&void 0!==e?(h.pick=e,h.dealer=r.list[e]):(h.pick=0,h.dealer=void 0)};var x=new m({url:"https://gt-forza.vercel.app/graphql"});const k=()=>{w(!0),s(a,0),x.query({operationName:"Uuid",query:"\n query Uuid($count: Int!) {\n uuid(count: $count)\n }\n",variables:{count:1}}).then((e=>{const r=e.data.uuid[0];x.query({operationName:"Solution",query:"\n query Solution($id: String!) {\n solution(id: $id) {\n id\n data {\n dealers {\n dealerId\n name\n vehicles {\n vin\n year\n make\n model\n color\n }\n }\n }\n }\n }\n",variables:{id:r}}).then((e=>{const t=JSON.parse(JSON.stringify(e.data.solution.data.dealers)),o={id:r,list:t};s(i,o),v(o)}))}))},j=()=>{w();const e=l(i),r=l(a);e?(v(e),r&&y(r)):k()},O=k,S=e=>{s(a,e),y(e)},z=(...e)=>e.filter(Boolean).join(" "),E=e=>{const{value:r}=e,{dealerId:o,name:n,vehicles:i}=r||{},a=i?i.length:0;return t("div",{class:z("flex flex-wrap content-center","mb-4 rounded-lg bg-blue-200 p-4","border border-solid border-blue-400")},t("label",{class:"text-xl font-bold"},n?`${n} `:"",t("sup",null,a||"")),t("label",{class:"ml-auto self-center text-right text-sm"},o||""))},$=/^\#[0-9]*/,C=e=>null!=e.match($),N=e=>2554===e,q=e=>e>2010,A=e=>{const{vin:r,make:o,model:n,year:i,color:a}=e.value||{};return t("div",{class:z("flex align-middle","mb-1 rounded-lg p-4","border border-solid",N(i)?"border-clrs-navy bg-clrs-navy text-clrs-white":C(n)?"border-yellow-600 bg-yellow-300":q(i)?"border-green-600 bg-green-200":"border-gray-600 bg-gray-300")},t("div",{class:"mr-1.5 flex flex-col"},t("label",{class:"mb-2 text-xs"},r||""),t("label",{class:"text-lg font-bold"},o||""),t("label",{class:"mb-2 text-sm italic"},n||""),t("label",null,i||"",", ",a||""),t("label",null,N(i)?"- exotic... [ Sierra 117 ]":C(n)?"- track only...":"")),t("proto-ikon-loader",{class:"ikon ml-auto self-center",name:o,label:o.toLowerCase()}))},I=e=>{const{list:r}=e,o=r.length;return 0===o?"":t("div",{class:"flex flex-col"},o?r.map((e=>t(A,{value:e}))):"")},T=e=>{const{dealer:r}=e,{vehicles:o}=r||{vehicles:[]},n=o;return r?t("div",{class:"flex flex-col"},t(E,{value:r}),t(I,{list:n})):""},P="eswat2",U=()=>t("a",{class:"absolute right-0 top-0 text-clrs-gray hover:text-clrs-navy",href:"https://eswat2.dev","aria-label":P,target:"blank",title:P},t("proto-ikon-loader",{name:"fingerprint",size:24,label:"eswat2"})),J=()=>t("div",{class:"mb-4 mr-2 mt-2 flex flex-row"},t("label",{class:"ml-auto align-top text-xs italic text-clrs-slate4"},"Tailwind ","3.4.16")),M=e=>{const{label:r}=e;return t("h1",{class:z("text-center uppercase text-clrs-red","mb-11 ml-0 mr-0 mt-11","text-6xl font-thin")},r)},_=e=>{const r=e.hex||"currentColor",o=e.label||"loading...",n=e.size||24;return t("svg",{class:z(e.class||"","animate-spin"),width:n,height:n,fill:"none",viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,o),t("g",null,t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:r,"stroke-width":"4"}),t("path",{class:"opacity-75",fill:r,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},D=()=>{const{loading:e,pick:r,data:o}=h||{},{list:n}=o||{list:[]},i=n.length-1;return e?"":t("div",{class:"flex"},t("div",{class:"refresh hover:text-clrs-red md:w-auto",onClick:()=>O()},t("proto-ikon-loader",{name:"refresh",size:24})),t("div",{class:z("ml-auto inline-flex justify-end","border border-solid border-gray-600","rounded-md")},n.map(((e,o)=>t("button",{class:z("h-8 w-8 border-none font-bold",0==o?"rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":o==i?"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":"rounded-none",r==o?"bg-clrs-red text-white":"bg-clrs-yellow text-clrs-navy"),onClick:()=>S(o),title:`${e.name} (${e.vehicles.length})`},o+1)))))},V=class{constructor(e){o(this,e),this.tag="proto-autos"}componentDidLoad(){j()}render(){const{loading:e,dealer:r}=h;return t("main",{key:"eb918bee95389cd4c78c6a7b3134ada507c5a042",id:"app",class:"ds1-main relative"},t(U,{key:"efa617ee04ddd6c58650d1cf4d00f899c3520efa"}),t(M,{key:"6762516c1c9fc2d4490e9343d75f4f09f657fae6",label:"Auto Dealers"}),t(D,{key:"ce1aeeb560729f66726b859d6f9d5a4a410703b1"}),e?t(_,null):t("hr",{class:z("mb-4 ml-0 mr-0 mt-4","border-solid border-gray-300","border-b-0 border-l-0 border-r-0")}),t(T,{key:"63ef8ba16a60533a147c06e126442e9f2481f8fe",dealer:r}),t(J,{key:"00d32c34fcf933386a5e5f920e09f02f95dbfbf1"}))}};V.style="*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.ds1-main{margin:1.5rem;display:flex;flex-direction:column;font-family:ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',\n 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';color:var(--clrs-navy, #001f3f);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.absolute{position:absolute}.relative{position:relative}.right-0{right:0px}.top-0{top:0px}.mb-1{margin-bottom:0.25rem}.mb-11{margin-bottom:2.75rem}.mb-2{margin-bottom:0.5rem}.mb-4{margin-bottom:1rem}.ml-0{margin-left:0px}.ml-auto{margin-left:auto}.mr-0{margin-right:0px}.mr-1\\.5{margin-right:0.375rem}.mr-2{margin-right:0.5rem}.mt-11{margin-top:2.75rem}.mt-2{margin-top:0.5rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.h-8{height:2rem}.w-8{width:2rem}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-center{align-content:center}.justify-end{justify-content:flex-end}.self-center{align-self:center}.rounded-lg{border-radius:0.5rem}.rounded-md{border-radius:0.375rem}.rounded-none{border-radius:0px}.rounded-bl-md{border-bottom-left-radius:0.375rem}.rounded-bl-none{border-bottom-left-radius:0px}.rounded-br-md{border-bottom-right-radius:0.375rem}.rounded-br-none{border-bottom-right-radius:0px}.rounded-tl-md{border-top-left-radius:0.375rem}.rounded-tl-none{border-top-left-radius:0px}.rounded-tr-md{border-top-right-radius:0.375rem}.rounded-tr-none{border-top-right-radius:0px}.border{border-width:1px}.border-b-0{border-bottom-width:0px}.border-l-0{border-left-width:0px}.border-r-0{border-right-width:0px}.border-solid{border-style:solid}.border-none{border-style:none}.border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.border-clrs-navy{border-color:var(--clrs-navy, #001f3f)}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-600{--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-green-600{--tw-border-opacity:1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.border-yellow-600{--tw-border-opacity:1;border-color:rgb(202 138 4 / var(--tw-border-opacity, 1))}.bg-blue-200{--tw-bg-opacity:1;background-color:rgb(191 219 254 / var(--tw-bg-opacity, 1))}.bg-clrs-navy{background-color:var(--clrs-navy, #001f3f)}.bg-clrs-red{background-color:var(--clrs-red, #ff4136)}.bg-clrs-yellow{background-color:var(--clrs-yellow, #ffdc00)}.bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-green-200{--tw-bg-opacity:1;background-color:rgb(187 247 208 / var(--tw-bg-opacity, 1))}.bg-yellow-300{--tw-bg-opacity:1;background-color:rgb(253 224 71 / var(--tw-bg-opacity, 1))}.p-4{padding:1rem}.text-center{text-align:center}.text-right{text-align:right}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.font-bold{font-weight:700}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.italic{font-style:italic}.text-clrs-gray{color:var(--clrs-gray, #aaaaaa)}.text-clrs-navy{color:var(--clrs-navy, #001f3f)}.text-clrs-red{color:var(--clrs-red, #ff4136)}.text-clrs-slate4{color:var(--clrs-slate4, #4e5964)}.text-clrs-white{color:var(--clrs-white, #ffffff)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-25{opacity:0.25}.opacity-75{opacity:0.75}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),\n 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.ikon{height:96px;width:96px}@media (min-width: 500px){.ikon{height:144px;width:144px}}@media (min-width: 700px){.ikon{height:192px;width:192px}}.hover\\:text-clrs-navy:hover{color:var(--clrs-navy, #001f3f)}.hover\\:text-clrs-red:hover{color:var(--clrs-red, #ff4136)}@media (min-width: 768px){.md\\:w-auto{width:auto}}";export{V as proto_autos}
|
|
1
|
+
import{g as e,f as r,h as t,r as o}from"./p-d092c4aa.js";const n="proto-autos",i="data",a="pick",l=e=>{const r=localStorage.getItem(e?`${n}-${e}`:n);return r?JSON.parse(r):void 0},s=(e,r)=>{const t=e?`${n}-${e}`:n,o=JSON.stringify(r);localStorage.setItem(t,o)},c=e=>!("isConnected"in e)||e.isConnected,d=(()=>{let e;return(...r)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let r of e.keys())e.set(r,e.get(r).filter(c))})(...r)}),2e3)}})(),u=e=>"function"==typeof e?e():e;var f=function(){function e(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(r,t,o){return t&&e(r.prototype,t),o&&e(r,o),r}}();function b(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}var p=function(){function e(){var r=this;b(this,e),this.interceptors=[],this.fetch=function(){for(var e=arguments.length,t=Array(e),o=0;o<e;o++)t[o]=arguments[o];return r.interceptorWrapper.apply(r,[fetch].concat(t))}}return f(e,[{key:"addInterceptors",value:function(e){var r=this,t=[];return Array.isArray(e)?e.map((function(e){return t.push(r.interceptors.length),r.interceptors.push(e)})):e instanceof Object&&(t.push(this.interceptors.length),this.interceptors.push(e)),this.updateInterceptors(),function(){return r.removeInterceptors(t)}}},{key:"removeInterceptors",value:function(e){var r=this;Array.isArray(e)&&(e.map((function(e){return r.interceptors.splice(e,1)})),this.updateInterceptors())}},{key:"updateInterceptors",value:function(){this.reversedInterceptors=this.interceptors.reduce((function(e,r){return[r].concat(e)}),[])}},{key:"clearInterceptors",value:function(){this.interceptors=[],this.updateInterceptors()}},{key:"interceptorWrapper",value:function(e){for(var r=arguments.length,t=Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];var n=Promise.resolve(t);return this.reversedInterceptors.forEach((function(e){var r=e.request,o=e.requestError;(r||o)&&(n=n.then((function(){return r.apply(void 0,t)}),o))})),n=n.then((function(){return e.apply(void 0,t)})),this.reversedInterceptors.forEach((function(e){var r=e.response,t=e.responseError;(r||t)&&(n=n.then(r,t))})),n}}]),e}(),m=function(){function e(r){var t=r.url,o=r.interceptors,n=r.headers,i=r.onStart,a=r.onEnd,l=r.omitEmptyVariables,s=void 0!==l&&l,c=r.requestOptions,d=void 0===c?{}:c;b(this,e);var u=function(e,r){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!r||"object"!=typeof r&&"function"!=typeof r?e:r}(this,(e.__proto__||Object.getPrototypeOf(e)).call(this));return u.requestObject=Object.assign({},{method:"POST",headers:Object.assign({},{Accept:"application/json","Content-Type":"application/json"},n),credentials:"same-origin"},d),u.url=t,u.omitEmptyVariables=s,u.requestQueueLength=0,u.EnumMap={},u.callbacks={onStart:i,onEnd:a},u.addInterceptors(o),u}return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function, not "+typeof r);e.prototype=Object.create(r&&r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),r&&(Object.setPrototypeOf?Object.setPrototypeOf(e,r):e.__proto__=r)}(e,p),f(e,[{key:"query",value:function(e){var r,t=this,o=e.operationName,n=e.query,i=e.variables,a=e.opts,l=void 0===a?{}:a,s=e.requestOptions,c=Object.assign({},this.requestObject,void 0===s?{}:s);return r=this.omitEmptyVariables||l.omitEmptyVariables?this.doOmitEmptyVariables(i):i,c.body=JSON.stringify({operationName:o,query:n,variables:r}),this.onStart(),this.fetch(this.url,c).then((function(e){return e.ok?e.json():{errors:[{message:e.statusText,stack:e}]}})).then((function(e){var r=e.data,o=e.errors;return new Promise((function(e,n){return t.onEnd(),r?Object.keys(r).every((function(e){return!r[e]}))?n(o):e({data:r,errors:o}):n(o||[{}])}))}))}},{key:"getUrl",value:function(){return this.url}},{key:"setUrl",value:function(e){this.url=e}},{key:"getEnumTypes",value:function(e){var r=this,t={},o=e.filter((function(e){return!r.EnumMap[e]||(t[e]=r.EnumMap[e],!1)}));if(!o.length)return new Promise((function(e){e({data:t})}));var n="\n query {\n "+o.map((function(e){return e+': __type(name: "'+e+'") {\n ...EnumFragment\n }'})).join("\n")+"\n }\n \n fragment EnumFragment on __Type {\n kind\n description\n enumValues {\n name\n description\n }\n }",i=Object.assign({},this.requestObject);return i.body=JSON.stringify({query:n}),this.onStart(),this.fetch(this.url,i).then((function(e){return e.ok?e.json():{errors:[{message:e.statusText,stack:e}]}})).then((function(e){var o=e.data,n=e.errors;return new Promise((function(e,i){if(r.onEnd(),!o)return i(n||[{message:"Do not get any data."}]);if(Object.keys(o).every((function(e){return!o[e]}))&&n&&n.length)return i(n);var a=Object.assign(t,o);return Object.keys(o).map((function(e){return r.EnumMap[e]=o[e],e})),e({data:a,errors:n})}))}))}},{key:"onStart",value:function(){this.requestQueueLength++,this.requestQueueLength>1||!this.callbacks.onStart||this.callbacks.onStart(this.requestQueueLength)}},{key:"onEnd",value:function(){this.requestQueueLength--,!this.requestQueueLength&&this.callbacks.onEnd&&this.callbacks.onEnd(this.requestQueueLength)}},{key:"doOmitEmptyVariables",value:function(e){var r=this,t={};return Object.keys(e).map((function(o){var n=e[o];return"string"==typeof n&&0===n.length||null==n||(t[o]=n instanceof Object?r.doOmitEmptyVariables(n):n),o})),t}}]),e}();const g={loading:!1,error:void 0,data:void 0,pick:0,dealer:void 0},{state:h}=(()=>{const t=((e,r=((e,r)=>e!==r))=>{const t=u(e);let o=new Map(Object.entries(null!=t?t:{}));const n={dispose:[],get:[],set:[],reset:[]},i=()=>{var r;o=new Map(Object.entries(null!==(r=u(e))&&void 0!==r?r:{})),n.reset.forEach((e=>e()))},a=e=>(n.get.forEach((r=>r(e))),o.get(e)),l=(e,t)=>{const i=o.get(e);r(t,i,e)&&(o.set(e,t),n.set.forEach((r=>r(e,t,i))))},s="undefined"==typeof Proxy?{}:new Proxy(t,{get:(e,r)=>a(r),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,r)=>o.has(r),set:(e,r,t)=>(l(r,t),!0)}),c=(e,r)=>(n[e].push(r),()=>{((e,r)=>{const t=e.indexOf(r);t>=0&&(e[t]=e[e.length-1],e.length--)})(n[e],r)});return{state:s,get:a,set:l,on:c,onChange:(r,t)=>{const o=c("set",((e,o)=>{e===r&&t(o)})),n=c("reset",(()=>t(u(e)[r])));return()=>{o(),n()}},use:(...e)=>{const r=e.reduce(((e,r)=>(r.set&&e.push(c("set",r.set)),r.get&&e.push(c("get",r.get)),r.reset&&e.push(c("reset",r.reset)),r.dispose&&e.push(c("dispose",r.dispose)),e)),[]);return()=>r.forEach((e=>e()))},dispose:()=>{n.dispose.forEach((e=>e())),i()},reset:i,forceUpdate:e=>{const r=o.get(e);n.set.forEach((t=>t(e,r,r)))}}})(g,void 0);return t.use((()=>{if("function"!=typeof e)return{};const t=new Map;return{dispose:()=>t.clear(),get:r=>{const o=e();o&&((e,r,t)=>{const o=e.get(r);o?o.includes(t)||o.push(t):e.set(r,[t])})(t,r,o)},set:e=>{const o=t.get(e);o&&t.set(e,o.filter(r)),d(t)},reset:()=>{t.forEach((e=>e.forEach(r))),d(t)}}})()),t})(),w=(e=!1)=>{h.loading=e,h.error=void 0,h.pick=0,h.data=void 0,h.dealer=void 0},v=e=>{if(e){const{pick:r}=h;h.dealer=null!=r?e.list[r]:void 0,h.data=e,h.loading=!1}else h.data=void 0,h.loading=!1},y=e=>{const{data:r}=h;r&&void 0!==e?(h.pick=e,h.dealer=r.list[e]):(h.pick=0,h.dealer=void 0)};var x=new m({url:"https://gt-forza.vercel.app/graphql"});const k=()=>{w(!0),s(a,0),x.query({operationName:"Uuid",query:"\n query Uuid($count: Int!) {\n uuid(count: $count)\n }\n",variables:{count:1}}).then((e=>{const r=e.data.uuid[0];x.query({operationName:"Solution",query:"\n query Solution($id: String!) {\n solution(id: $id) {\n id\n data {\n dealers {\n dealerId\n name\n vehicles {\n vin\n year\n make\n model\n color\n }\n }\n }\n }\n }\n",variables:{id:r}}).then((e=>{const t=JSON.parse(JSON.stringify(e.data.solution.data.dealers)),o={id:r,list:t};s(i,o),v(o)}))}))},j=()=>{w();const e=l(i),r=l(a);e?(v(e),r&&y(r)):k()},O=k,S=e=>{s(a,e),y(e)},z=(...e)=>e.filter(Boolean).join(" "),E=e=>{const{value:r}=e,{dealerId:o,name:n,vehicles:i}=r||{},a=i?i.length:0;return t("div",{class:z("flex flex-wrap content-center","mb-4 rounded-lg bg-blue-200 p-4","border border-solid border-blue-400")},t("label",{class:"text-xl font-bold"},n?`${n} `:"",t("sup",null,a||"")),t("label",{class:"ml-auto self-center text-right text-sm"},o||""))},$=/^\#[0-9]*/,C=e=>null!=e.match($),N=e=>2554===e,q=e=>e>2010,A=e=>{const{vin:r,make:o,model:n,year:i,color:a}=e.value||{};return t("div",{class:z("flex align-middle","mb-1 rounded-lg p-4","border border-solid",N(i)?"border-clrs-navy bg-clrs-navy text-clrs-white":C(n)?"border-yellow-600 bg-yellow-300":q(i)?"border-green-600 bg-green-200":"border-gray-600 bg-gray-300")},t("div",{class:"mr-1.5 flex flex-col"},t("label",{class:"mb-2 text-xs"},r||""),t("label",{class:"text-lg font-bold"},o||""),t("label",{class:"mb-2 text-sm italic"},n||""),t("label",null,i||"",", ",a||""),t("label",null,N(i)?"- exotic... [ Sierra 117 ]":C(n)?"- track only...":"")),t("proto-ikon-loader",{class:"ikon ml-auto self-center",name:o,label:o.toLowerCase()}))},I=e=>{const{list:r}=e,o=r.length;return 0===o?"":t("div",{class:"flex flex-col"},o?r.map((e=>t(A,{value:e}))):"")},T=e=>{const{dealer:r}=e,{vehicles:o}=r||{vehicles:[]},n=o;return r?t("div",{class:"flex flex-col"},t(E,{value:r}),t(I,{list:n})):""},P="eswat2",U=()=>t("a",{class:"absolute right-0 top-0 text-clrs-gray hover:text-clrs-navy",href:"https://eswat2.dev","aria-label":P,target:"blank",title:P},t("proto-ikon-loader",{name:"fingerprint",size:24,label:"eswat2"})),J=()=>t("div",{class:"mb-4 mr-2 mt-2 flex flex-row"},t("label",{class:"ml-auto align-top text-xs italic text-clrs-slate4"},"Tailwind ","3.4.17")),M=e=>{const{label:r}=e;return t("h1",{class:z("text-center uppercase text-clrs-red","mb-11 ml-0 mr-0 mt-11","text-6xl font-thin")},r)},_=e=>{const r=e.hex||"currentColor",o=e.label||"loading...",n=e.size||24;return t("svg",{class:z(e.class||"","animate-spin"),width:n,height:n,fill:"none",viewBox:"0 0 24 24",role:"img","aria-label":"title"},t("title",null,o),t("g",null,t("circle",{class:"opacity-25",cx:"12",cy:"12",r:"10",stroke:r,"stroke-width":"4"}),t("path",{class:"opacity-75",fill:r,d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})),t("path",{d:"M0 0h24v24H0z",fill:"none"}))},D=()=>{const{loading:e,pick:r,data:o}=h||{},{list:n}=o||{list:[]},i=n.length-1;return e?"":t("div",{class:"flex"},t("div",{class:"refresh hover:text-clrs-red md:w-auto",onClick:()=>O()},t("proto-ikon-loader",{name:"refresh",size:24})),t("div",{class:z("ml-auto inline-flex justify-end","border border-solid border-gray-600","rounded-md")},n.map(((e,o)=>t("button",{class:z("h-8 w-8 border-none font-bold",0==o?"rounded-bl-md rounded-br-none rounded-tl-md rounded-tr-none":o==i?"rounded-bl-none rounded-br-md rounded-tl-none rounded-tr-md":"rounded-none",r==o?"bg-clrs-red text-white":"bg-clrs-yellow text-clrs-navy"),onClick:()=>S(o),title:`${e.name} (${e.vehicles.length})`},o+1)))))},V=class{constructor(e){o(this,e),this.tag="proto-autos"}componentDidLoad(){j()}render(){const{loading:e,dealer:r}=h;return t("main",{key:"eb918bee95389cd4c78c6a7b3134ada507c5a042",id:"app",class:"ds1-main relative"},t(U,{key:"efa617ee04ddd6c58650d1cf4d00f899c3520efa"}),t(M,{key:"6762516c1c9fc2d4490e9343d75f4f09f657fae6",label:"Auto Dealers"}),t(D,{key:"ce1aeeb560729f66726b859d6f9d5a4a410703b1"}),e?t(_,null):t("hr",{class:z("mb-4 ml-0 mr-0 mt-4","border-solid border-gray-300","border-b-0 border-l-0 border-r-0")}),t(T,{key:"63ef8ba16a60533a147c06e126442e9f2481f8fe",dealer:r}),t(J,{key:"00d32c34fcf933386a5e5f920e09f02f95dbfbf1"}))}};V.style="*,::before,::after{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-scroll-snap-strictness:proximity;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgb(59 130 246 / 0.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;}.ds1-main{margin:1.5rem;display:flex;flex-direction:column;font-family:ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji',\n 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';color:var(--clrs-navy, #001f3f);-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.absolute{position:absolute}.relative{position:relative}.right-0{right:0px}.top-0{top:0px}.mb-1{margin-bottom:0.25rem}.mb-11{margin-bottom:2.75rem}.mb-2{margin-bottom:0.5rem}.mb-4{margin-bottom:1rem}.ml-0{margin-left:0px}.ml-auto{margin-left:auto}.mr-0{margin-right:0px}.mr-1\\.5{margin-right:0.375rem}.mr-2{margin-right:0.5rem}.mt-11{margin-top:2.75rem}.mt-2{margin-top:0.5rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.h-8{height:2rem}.w-8{width:2rem}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.content-center{align-content:center}.justify-end{justify-content:flex-end}.self-center{align-self:center}.rounded-lg{border-radius:0.5rem}.rounded-md{border-radius:0.375rem}.rounded-none{border-radius:0px}.rounded-bl-md{border-bottom-left-radius:0.375rem}.rounded-bl-none{border-bottom-left-radius:0px}.rounded-br-md{border-bottom-right-radius:0.375rem}.rounded-br-none{border-bottom-right-radius:0px}.rounded-tl-md{border-top-left-radius:0.375rem}.rounded-tl-none{border-top-left-radius:0px}.rounded-tr-md{border-top-right-radius:0.375rem}.rounded-tr-none{border-top-right-radius:0px}.border{border-width:1px}.border-b-0{border-bottom-width:0px}.border-l-0{border-left-width:0px}.border-r-0{border-right-width:0px}.border-solid{border-style:solid}.border-none{border-style:none}.border-blue-400{--tw-border-opacity:1;border-color:rgb(96 165 250 / var(--tw-border-opacity, 1))}.border-clrs-navy{border-color:var(--clrs-navy, #001f3f)}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1))}.border-gray-600{--tw-border-opacity:1;border-color:rgb(75 85 99 / var(--tw-border-opacity, 1))}.border-green-600{--tw-border-opacity:1;border-color:rgb(22 163 74 / var(--tw-border-opacity, 1))}.border-yellow-600{--tw-border-opacity:1;border-color:rgb(202 138 4 / var(--tw-border-opacity, 1))}.bg-blue-200{--tw-bg-opacity:1;background-color:rgb(191 219 254 / var(--tw-bg-opacity, 1))}.bg-clrs-navy{background-color:var(--clrs-navy, #001f3f)}.bg-clrs-red{background-color:var(--clrs-red, #ff4136)}.bg-clrs-yellow{background-color:var(--clrs-yellow, #ffdc00)}.bg-gray-300{--tw-bg-opacity:1;background-color:rgb(209 213 219 / var(--tw-bg-opacity, 1))}.bg-green-200{--tw-bg-opacity:1;background-color:rgb(187 247 208 / var(--tw-bg-opacity, 1))}.bg-yellow-300{--tw-bg-opacity:1;background-color:rgb(253 224 71 / var(--tw-bg-opacity, 1))}.p-4{padding:1rem}.text-center{text-align:center}.text-right{text-align:right}.align-top{vertical-align:top}.align-middle{vertical-align:middle}.text-6xl{font-size:3.75rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:0.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:0.75rem;line-height:1rem}.font-bold{font-weight:700}.font-thin{font-weight:100}.uppercase{text-transform:uppercase}.italic{font-style:italic}.text-clrs-gray{color:var(--clrs-gray, #aaaaaa)}.text-clrs-navy{color:var(--clrs-navy, #001f3f)}.text-clrs-red{color:var(--clrs-red, #ff4136)}.text-clrs-slate4{color:var(--clrs-slate4, #4e5964)}.text-clrs-white{color:var(--clrs-white, #ffffff)}.text-white{--tw-text-opacity:1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.opacity-25{opacity:0.25}.opacity-75{opacity:0.75}.shadow{--tw-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);--tw-shadow-colored:0 1px 3px 0 var(--tw-shadow-color),\n 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),\n var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.ikon{height:96px;width:96px}@media (min-width: 500px){.ikon{height:144px;width:144px}}@media (min-width: 700px){.ikon{height:192px;width:192px}}.hover\\:text-clrs-navy:hover{color:var(--clrs-navy, #001f3f)}.hover\\:text-clrs-red:hover{color:var(--clrs-red, #ff4136)}@media (min-width: 768px){.md\\:w-auto{width:auto}}";export{V as proto_autos}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as a,b as o}from"./p-d092c4aa.js";export{s as setNonce}from"./p-d092c4aa.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),a(s)})().then((async a=>(await t(),o([["p-
|
|
1
|
+
import{p as a,b as o}from"./p-d092c4aa.js";export{s as setNonce}from"./p-d092c4aa.js";import{g as t}from"./p-e1255160.js";(()=>{const o=import.meta.url,s={};return""!==o&&(s.resourcesUrl=new URL(".",o).href),a(s)})().then((async a=>(await t(),o([["p-2d301e50",[[1,"proto-autos",{tag:[1]}]]]],a))));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "proto-autos-wc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.967",
|
|
4
4
|
"description": "prototype - a simple GraphQL demo rendered in Stencil and Tailwind",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
"@stencil/core": "4.23.0",
|
|
31
31
|
"@stencil/store": "2.0.16",
|
|
32
32
|
"fetchql": "3.0.0",
|
|
33
|
-
"proto-tailwindcss-clrs": "0.0.
|
|
34
|
-
"tailwindcss": "3.4.
|
|
33
|
+
"proto-tailwindcss-clrs": "0.0.389",
|
|
34
|
+
"tailwindcss": "3.4.17"
|
|
35
35
|
},
|
|
36
36
|
"license": "MIT",
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"autoprefixer": "10.4.20",
|
|
39
39
|
"concurrently": "9.1.0",
|
|
40
|
-
"cspell": "8.17.
|
|
40
|
+
"cspell": "8.17.1",
|
|
41
41
|
"eslint": "9.17.0",
|
|
42
42
|
"postcss": "8.4.49",
|
|
43
43
|
"prettier": "3.4.2",
|