pdap-design-system 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,29 @@
1
+ declare const _default: import("vue").DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
2
+ mode: 'dev' | 'prod';
3
+ }>, {
4
+ mode: string;
5
+ }>, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
6
+ mode: 'dev' | 'prod';
7
+ }>, {
8
+ mode: string;
9
+ }>>>, {
10
+ mode: 'dev' | 'prod';
11
+ }, {}>;
12
+ export default _default;
13
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
14
+ type __VLS_TypePropsToRuntimeProps<T> = {
15
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
16
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
17
+ } : {
18
+ type: import('vue').PropType<T[K]>;
19
+ required: true;
20
+ };
21
+ };
22
+ type __VLS_WithDefaults<P, D> = {
23
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
24
+ default: D[K];
25
+ }> : P[K];
26
+ };
27
+ type __VLS_Prettify<T> = {
28
+ [K in keyof T]: T[K];
29
+ } & {};
@@ -0,0 +1,2 @@
1
+ import QuickSearchForm from './QuickSearchForm.vue';
2
+ export { QuickSearchForm };
@@ -9,4 +9,5 @@ export { InputCheckbox } from './Input/Checkbox';
9
9
  export { InputText } from './Input/Text';
10
10
  export { Header } from './Header';
11
11
  export { Nav } from './Nav';
12
+ export { QuickSearchForm } from './QuickSearchForm';
12
13
  export { TileIcon } from './TileIcon';
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),ie=require("vue-router"),Ce=t.defineComponent({__name:"PdapButton",props:{intent:{default:"primary"},isLoading:{type:Boolean,default:!1}},setup(e){const n=e,r=t.reactive({"pdap-button":!0,[`pdap-button-${n.intent}`]:!!n.intent,"pdap-button-loading":n.isLoading});return(a,o)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(r)},[t.renderSlot(a.$slots,"default")],2))}});const ce=t.defineComponent({__name:"FlexContainer",props:{alignment:{default:"start"},component:{default:"div"}},setup(e){const n=e,r=t.reactive({"pdap-flex-container":!0,[`pdap-flex-container-${n.alignment}`]:!0});return(a,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.component),{class:t.normalizeClass(r)},{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default")]),_:3},8,["class"]))}});const ke={class:"pdap-footer"},Re={class:"pdap-footer-social-links"},Oe=["href"],Ve=t.createElementVNode("p",{class:"pdap-footer-copyright"},[t.createTextVNode(" © 2023 Police Data Accessibility Project"),t.createElementVNode("br")],-1),Be=t.createElementVNode("p",{class:"pdap-footer-copyright"},[t.createTextVNode(" PDAP is a non-profit. EIN: 85-4207132. "),t.createElementVNode("a",{href:"https://docs.pdap.io/meta/policy/pdap-privacy-policy",alt:"Privacy Policy"}," Privacy Policy"),t.createTextVNode(". "),t.createElementVNode("a",{href:"mailto:contact@pdap.io"},"contact@pdap.io")],-1),je={class:"pdap-footer-widget-links"},Ie=t.createElementVNode("a",{href:"https://www.guidestar.org/profile/85-4207132",target:"_blank"},[t.createElementVNode("img",{src:"https://widgets.guidestar.org/gximage2?o=9973356&l=v4"})],-1),Ae=["href"],Te=["src"],Ne=["src"],Le=t.defineComponent({__name:"PdapFooter",props:{logoImageSrc:{default:"node_modules/pdap-design-system/dist/images/acronym.svg"},logoImageAnchorPath:{default:"/"}},setup(e){const n=e,r=t.inject("footerLinks",[{href:"https://github.com/orgs/Police-Data-Accessibility-Project",text:"Github"},{href:"ttps://discord.gg/wMqex8nKZJ",text:"Discord"},{href:"https://www.linkedin.com/company/pdap",text:"LinkedIn"},{path:"/jobs",text:"Jobs"}]),a=n.logoImageAnchorPath.startsWith("/");return(o,s)=>{const l=t.resolveComponent("router-link");return t.openBlock(),t.createElementBlock("footer",ke,[t.createVNode(ce,{alignment:"center"},{default:t.withCtx(()=>[t.createElementVNode("ul",Re,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(r),c=>(t.openBlock(),t.createElementBlock("li",{key:c.text,class:"pdap-footer-link-container"},[c.href?(t.openBlock(),t.createElementBlock("a",{key:0,class:"pdap-footer-social-link",href:c.href,target:"_blank",referrerpolicy:"no-referrer"},t.toDisplayString(c.text),9,Oe)):t.createCommentVNode("",!0),c.path?(t.openBlock(),t.createBlock(l,{key:1,"active-class":"pdap-footer-social-link-current","exact-active-class":"pdap-footer-social-link-current-exact",class:"pdap-footer-social-link",to:c.path},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(c.text),1)]),_:2},1032,["to"])):t.createCommentVNode("",!0)]))),128))]),Ve,Be,t.createElementVNode("div",je,[Ie,t.unref(a)?(t.openBlock(),t.createBlock(l,{key:1,to:o.logoImageAnchorPath,class:"pdap-footer-logo"},{default:t.withCtx(()=>[t.createElementVNode("img",{src:o.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,Ne)]),_:1},8,["to"])):(t.openBlock(),t.createElementBlock("a",{key:0,href:o.logoImageAnchorPath,class:"pdap-footer-logo"},[t.createElementVNode("img",{src:o.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,Te)],8,Ae))])]),_:1})])}}});function J(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function P(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?J(Object(r),!0).forEach(function(a){Se(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):J(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function Se(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function Q(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Object.keys(e).reduce((r,a)=>(n.includes(a)||(r[a]=t.unref(e[a])),r),{})}function N(e){return typeof e=="function"}function De(e){return t.isReactive(e)||t.isReadonly(e)}function le(e,n,r){let a=e;const o=n.split(".");for(let s=0;s<o.length;s++){if(!a[o[s]])return r;a=a[o[s]]}return a}function H(e,n,r){return t.computed(()=>e.some(a=>le(n,a,{[r]:!1})[r]))}function Y(e,n,r){return t.computed(()=>e.reduce((a,o)=>{const s=le(n,o,{[r]:!1})[r]||[];return a.concat(s)},[]))}function ue(e,n,r,a){return e.call(a,t.unref(n),t.unref(r),a)}function de(e){return e.$valid!==void 0?!e.$valid:!e}function ze(e,n,r,a,o,s,l){let{$lazy:c,$rewardEarly:d}=o,u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:[],p=arguments.length>8?arguments[8]:void 0,f=arguments.length>9?arguments[9]:void 0,g=arguments.length>10?arguments[10]:void 0;const h=t.ref(!!a.value),i=t.ref(0);r.value=!1;const m=t.watch([n,a].concat(u,g),()=>{if(c&&!a.value||d&&!f.value&&!r.value)return;let $;try{$=ue(e,n,p,l)}catch(v){$=Promise.reject(v)}i.value++,r.value=!!i.value,h.value=!1,Promise.resolve($).then(v=>{i.value--,r.value=!!i.value,s.value=v,h.value=de(v)}).catch(v=>{i.value--,r.value=!!i.value,s.value=v,h.value=!0})},{immediate:!0,deep:typeof n=="object"});return{$invalid:h,$unwatch:m}}function Me(e,n,r,a,o,s,l,c){let{$lazy:d,$rewardEarly:u}=a;const p=()=>({}),f=t.computed(()=>{if(d&&!r.value||u&&!c.value)return!1;let g=!0;try{const h=ue(e,n,l,s);o.value=h,g=de(h)}catch(h){o.value=h}return g});return{$unwatch:p,$invalid:f}}function Fe(e,n,r,a,o,s,l,c,d,u,p){const f=t.ref(!1),g=e.$params||{},h=t.ref(null);let i,m;e.$async?{$invalid:i,$unwatch:m}=ze(e.$validator,n,f,r,a,h,o,e.$watchTargets,d,u,p):{$invalid:i,$unwatch:m}=Me(e.$validator,n,r,a,h,o,d,u);const $=e.$message;return{$message:N($)?t.computed(()=>$(Q({$pending:f,$invalid:i,$params:Q(g),$model:n,$response:h,$validator:s,$propertyPath:c,$property:l}))):$||"",$params:g,$pending:f,$invalid:i,$response:h,$unwatch:m}}function qe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=t.unref(e),r=Object.keys(n),a={},o={},s={};let l=null;return r.forEach(c=>{const d=n[c];switch(!0){case N(d.$validator):a[c]=d;break;case N(d):a[c]={$validator:d};break;case c==="$validationGroups":l=d;break;case c.startsWith("$"):s[c]=d;break;default:o[c]=d}}),{rules:a,nestedValidators:o,config:s,validationGroups:l}}const He="__root";function Ge(e,n,r,a,o,s,l,c,d){const u=Object.keys(e),p=a.get(o,e),f=t.ref(!1),g=t.ref(!1),h=t.ref(0);if(p){if(!p.$partial)return p;p.$unwatch(),f.value=p.$dirty.value}const i={$dirty:f,$path:o,$touch:()=>{f.value||(f.value=!0)},$reset:()=>{f.value&&(f.value=!1)},$commit:()=>{}};return u.length?(u.forEach(m=>{i[m]=Fe(e[m],n,i.$dirty,s,l,m,r,o,d,g,h)}),i.$externalResults=t.computed(()=>c.value?[].concat(c.value).map((m,$)=>({$propertyPath:o,$property:r,$validator:"$externalResults",$uid:`${o}-externalResult-${$}`,$message:m,$params:{},$response:null,$pending:!1})):[]),i.$invalid=t.computed(()=>{const m=u.some($=>t.unref(i[$].$invalid));return g.value=m,!!i.$externalResults.value.length||m}),i.$pending=t.computed(()=>u.some(m=>t.unref(i[m].$pending))),i.$error=t.computed(()=>i.$dirty.value?i.$pending.value||i.$invalid.value:!1),i.$silentErrors=t.computed(()=>u.filter(m=>t.unref(i[m].$invalid)).map(m=>{const $=i[m];return t.reactive({$propertyPath:o,$property:r,$validator:m,$uid:`${o}-${m}`,$message:$.$message,$params:$.$params,$response:$.$response,$pending:$.$pending})}).concat(i.$externalResults.value)),i.$errors=t.computed(()=>i.$dirty.value?i.$silentErrors.value:[]),i.$unwatch=()=>u.forEach(m=>{i[m].$unwatch()}),i.$commit=()=>{g.value=!0,h.value=Date.now()},a.set(o,e,i),i):(p&&a.set(o,e,i),i)}function Ue(e,n,r,a,o,s,l){const c=Object.keys(e);return c.length?c.reduce((d,u)=>(d[u]=G({validations:e[u],state:n,key:u,parentKey:r,resultsCache:a,globalConfig:o,instance:s,externalResults:l}),d),{}):{}}function We(e,n,r){const a=t.computed(()=>[n,r].filter(i=>i).reduce((i,m)=>i.concat(Object.values(t.unref(m))),[])),o=t.computed({get(){return e.$dirty.value||(a.value.length?a.value.every(i=>i.$dirty):!1)},set(i){e.$dirty.value=i}}),s=t.computed(()=>{const i=t.unref(e.$silentErrors)||[],m=a.value.filter($=>(t.unref($).$silentErrors||[]).length).reduce(($,v)=>$.concat(...v.$silentErrors),[]);return i.concat(m)}),l=t.computed(()=>{const i=t.unref(e.$errors)||[],m=a.value.filter($=>(t.unref($).$errors||[]).length).reduce(($,v)=>$.concat(...v.$errors),[]);return i.concat(m)}),c=t.computed(()=>a.value.some(i=>i.$invalid)||t.unref(e.$invalid)||!1),d=t.computed(()=>a.value.some(i=>t.unref(i.$pending))||t.unref(e.$pending)||!1),u=t.computed(()=>a.value.some(i=>i.$dirty)||a.value.some(i=>i.$anyDirty)||o.value),p=t.computed(()=>o.value?d.value||c.value:!1),f=()=>{e.$touch(),a.value.forEach(i=>{i.$touch()})},g=()=>{e.$commit(),a.value.forEach(i=>{i.$commit()})},h=()=>{e.$reset(),a.value.forEach(i=>{i.$reset()})};return a.value.length&&a.value.every(i=>i.$dirty)&&f(),{$dirty:o,$errors:l,$invalid:c,$anyDirty:u,$error:p,$pending:d,$touch:f,$reset:h,$silentErrors:s,$commit:g}}function G(e){let{validations:n,state:r,key:a,parentKey:o,childResults:s,resultsCache:l,globalConfig:c={},instance:d,externalResults:u}=e;const p=o?`${o}.${a}`:a,{rules:f,nestedValidators:g,config:h,validationGroups:i}=qe(n),m=P(P({},c),h),$=a?t.computed(()=>{const y=t.unref(r);return y?t.unref(y[a]):void 0}):r,v=P({},t.unref(u)||{}),V=t.computed(()=>{const y=t.unref(u);return a?y?t.unref(y[a]):void 0:y}),z=Ge(f,$,a,l,p,m,d,V,r),w=Ue(g,$,p,l,m,d,V),k={};i&&Object.entries(i).forEach(y=>{let[R,x]=y;k[R]={$invalid:H(x,w,"$invalid"),$error:H(x,w,"$error"),$pending:H(x,w,"$pending"),$errors:Y(x,w,"$errors"),$silentErrors:Y(x,w,"$silentErrors")}});const{$dirty:b,$errors:A,$invalid:M,$anyDirty:ve,$error:ye,$pending:F,$touch:q,$reset:_e,$silentErrors:we,$commit:Z}=We(z,w,s),be=a?t.computed({get:()=>t.unref($),set:y=>{b.value=!0;const R=t.unref(r),x=t.unref(u);x&&(x[a]=v[a]),t.isRef(R[a])?R[a].value=y:R[a]=y}}):null;a&&m.$autoDirty&&t.watch($,()=>{b.value||q();const y=t.unref(u);y&&(y[a]=v[a])},{flush:"sync"});async function xe(){return q(),m.$rewardEarly&&(Z(),await t.nextTick()),await t.nextTick(),new Promise(y=>{if(!F.value)return y(!M.value);const R=t.watch(F,()=>{y(!M.value),R()})})}function Pe(y){return(s.value||{})[y]}function Ee(){t.isRef(u)?u.value=v:Object.keys(v).length===0?Object.keys(u).forEach(y=>{delete u[y]}):Object.assign(u,v)}return t.reactive(P(P(P({},z),{},{$model:be,$dirty:b,$error:ye,$errors:A,$invalid:M,$anyDirty:ve,$pending:F,$touch:q,$reset:_e,$path:p||He,$silentErrors:we,$validate:xe,$commit:Z},s&&{$getResultsForChild:Pe,$clearExternalResults:Ee,$validationGroups:k}),w))}class Ke{constructor(){this.storage=new Map}set(n,r,a){this.storage.set(n,{rules:r,result:a})}checkRulesValidity(n,r,a){const o=Object.keys(a),s=Object.keys(r);return s.length!==o.length||!s.every(c=>o.includes(c))?!1:s.every(c=>r[c].$params?Object.keys(r[c].$params).every(d=>t.unref(a[c].$params[d])===t.unref(r[c].$params[d])):!0)}get(n,r){const a=this.storage.get(n);if(!a)return;const{rules:o,result:s}=a,l=this.checkRulesValidity(n,r,o),c=s.$unwatch?s.$unwatch:()=>({});return l?s:{$dirty:s.$dirty,$partial:!0,$unwatch:c}}}const T={COLLECT_ALL:!0,COLLECT_NONE:!1},ee=Symbol("vuelidate#injectChildResults"),te=Symbol("vuelidate#removeChildResults");function Xe(e){let{$scope:n,instance:r}=e;const a={},o=t.ref([]),s=t.computed(()=>o.value.reduce((p,f)=>(p[f]=t.unref(a[f]),p),{}));function l(p,f){let{$registerAs:g,$scope:h,$stopPropagation:i}=f;i||n===T.COLLECT_NONE||h===T.COLLECT_NONE||n!==T.COLLECT_ALL&&n!==h||(a[g]=p,o.value.push(g))}r.__vuelidateInjectInstances=[].concat(r.__vuelidateInjectInstances||[],l);function c(p){o.value=o.value.filter(f=>f!==p),delete a[p]}r.__vuelidateRemoveInstances=[].concat(r.__vuelidateRemoveInstances||[],c);const d=t.inject(ee,[]);t.provide(ee,r.__vuelidateInjectInstances);const u=t.inject(te,[]);return t.provide(te,r.__vuelidateRemoveInstances),{childResults:s,sendValidationResultsToParent:d,removeValidationResultsFromParent:u}}function pe(e){return new Proxy(e,{get(n,r){return typeof n[r]=="object"?pe(n[r]):t.computed(()=>n[r])}})}let ne=0;function Ze(e,n){var r;let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};arguments.length===1&&(a=e,e=void 0,n=void 0);let{$registerAs:o,$scope:s=T.COLLECT_ALL,$stopPropagation:l,$externalResults:c,currentVueInstance:d}=a;const u=d||((r=t.getCurrentInstance())===null||r===void 0?void 0:r.proxy),p=u?u.$options:{};o||(ne+=1,o=`_vuelidate_${ne}`);const f=t.ref({}),g=new Ke,{childResults:h,sendValidationResultsToParent:i,removeValidationResultsFromParent:m}=u?Xe({$scope:s,instance:u}):{childResults:t.ref({})};if(!e&&p.validations){const $=p.validations;n=t.ref({}),t.onBeforeMount(()=>{n.value=u,t.watch(()=>N($)?$.call(n.value,new pe(n.value)):$,v=>{f.value=G({validations:v,state:n,childResults:h,resultsCache:g,globalConfig:a,instance:u,externalResults:c||u.vuelidateExternalResults})},{immediate:!0})}),a=p.validationsConfig||a}else{const $=t.isRef(e)||De(e)?e:t.reactive(e||{});t.watch($,v=>{f.value=G({validations:v,state:n,childResults:h,resultsCache:g,globalConfig:a,instance:u??{},externalResults:c})},{immediate:!0})}return u&&(i.forEach($=>$(f,{$registerAs:o,$scope:s,$stopPropagation:l})),t.onBeforeUnmount(()=>m.forEach($=>$(o)))),t.computed(()=>P(P({},t.unref(f.value)),h.value))}const Je=["for"],Qe=["id"],me=t.defineComponent({__name:"PdapInput",props:{id:{},label:{},name:{},error:{}},setup(e){const n=e,r=t.computed(()=>`pdap-${n.name}-input-error`);return t.watchEffect(()=>{console.debug(`Hello from PDAP Input ${n.name} rendered at ${window.location.pathname}`,{props:n})}),(a,o)=>{var s;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass({"pdap-input":!0,"pdap-input-error":((s=a.error)==null?void 0:s.length)>=1})},[t.renderSlot(a.$slots,"default"),t.createElementVNode("label",{class:"pdap-input-label",for:a.id},t.toDisplayString(a.label),9,Je),a.error?(t.openBlock(),t.createElementBlock("div",{key:0,id:r.value,class:"pdap-input-error-message"},t.toDisplayString(a.error),9,Qe)):t.createCommentVNode("",!0)],2)}}});const Ye=["id","name","value","placeholder"],fe=t.defineComponent({__name:"InputText",props:{placeholder:{},type:{},value:{},id:{},label:{},name:{},error:{}},emits:["input"],setup(e,{emit:n}){const r=e,a=n,o=s=>{a("input",s.target.value)};return t.watchEffect(()=>{console.debug(`Hello from PDAP InputText ${r.name} rendered at ${window.location.pathname}`,{props:r})}),(s,l)=>(t.openBlock(),t.createElementBlock("input",{id:s.id,type:"text",name:s.name,value:s.value,placeholder:s.placeholder,onInput:o},null,40,Ye))}}),et=["id","name","checked","value"],$e=t.defineComponent({__name:"InputCheckbox",props:{defaultChecked:{type:Boolean},type:{},value:{},id:{},label:{},name:{},error:{}},emits:["change"],setup(e,{emit:n}){const r=e,a=n,o=s=>{a("change",s.target.checked.toString())};return t.watchEffect(()=>{console.debug(`Hello from PDAP InputCheckbox ${r.name} rendered at ${window.location.pathname}`,{props:r})}),(s,l)=>(t.openBlock(),t.createElementBlock("input",{id:s.id,class:"pdap-input-checkbox",name:s.name,checked:s.defaultChecked,value:s.value,type:"checkbox",onChange:o},null,40,et))}});var L=(e=>(e.CHECKBOX="checkbox",e.TEXT="text",e))(L||{});const tt={[L.CHECKBOX]:"InputCheckbox",[L.TEXT]:"InputText"},nt={name:"InputsGenerator",components:{InputText:fe,InputCheckbox:$e,PdapInput:me},props:{schema:{type:Object},values:{type:Object},v$:{type:Object}},emits:["blur","input"],setup(e,{emit:n}){n("input"),n("blur")},data(){return{formData:this.values||{},INPUT_COMPONENT_MAP:tt,v:this.$props.v$}},methods:{updateForm(e,n){this.formData[e]=n,this.$emit("input",this.formData)},updateValidations(e){var n,r;(r=(n=this.v$)==null?void 0:n.value)==null||r[e].$touch}}},rt=(e,n)=>{const r=e.__vccOpts||e;for(const[a,o]of n)r[a]=o;return r};function at(e,n,r,a,o,s){const l=t.resolveComponent("PdapInput");return t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.schema,c=>{var d,u,p,f;return t.openBlock(),t.createBlock(l,{id:c.id,key:c.name,error:(f=(p=(u=(d=o.v)==null?void 0:d[c.name])==null?void 0:u.$errors)==null?void 0:p[0])==null?void 0:f.$message,name:c.name,label:c.label},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.INPUT_COMPONENT_MAP[c.type]),t.mergeProps(c,{value:o.formData[c.name],onBlur:g=>s.updateValidations(c.name),onInput:g=>s.updateForm(c.name,g)}),null,16,["value","onBlur","onInput"]))]),_:2},1032,["id","error","name","label"])}),128)}const ot=rt(nt,[["render",at]]);function re(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function B(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?re(Object(r),!0).forEach(function(a){st(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):re(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function st(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function j(e){return typeof e=="function"}function S(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function D(e){return j(e.$validator)?B({},e):{$validator:e}}function it(e){return S(e)&&j(e.then)}function E(e){return typeof e=="object"?e.$valid:e}function O(e){return e.$validator||e}function U(e,n){if(!S(e))throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof e}`);if(!S(n)&&!j(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const r=D(n);return r.$params=B(B({},r.$params||{}),e),r}function I(e,n){if(!j(e)&&typeof t.unref(e)!="string")throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof e}`);if(!S(n)&&!j(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const r=D(n);return r.$message=e,r}function ct(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=D(e);return B(B({},r),{},{$async:!0,$watchTargets:n})}function lt(e){return{$validator(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return t.unref(n).reduce((s,l,c)=>{const d=Object.entries(l).reduce((u,p)=>{let[f,g]=p;const h=e[f]||{},i=Object.entries(h).reduce((m,$)=>{let[v,V]=$;const w=O(V).call(this,g,l,c,...a),k=E(w);if(m.$data[v]=w,m.$data.$invalid=!k||!!m.$data.$invalid,m.$data.$error=m.$data.$invalid,!k){let b=V.$message||"";const A=V.$params||{};typeof b=="function"&&(b=b({$pending:!1,$invalid:!k,$params:A,$model:g,$response:w})),m.$errors.push({$property:f,$message:b,$params:A,$response:w,$model:g,$pending:!1,$validator:v})}return{$valid:m.$valid&&k,$data:m.$data,$errors:m.$errors}},{$valid:!0,$data:{},$errors:[]});return u.$data[f]=i.$data,u.$errors[f]=i.$errors,{$valid:u.$valid&&i.$valid,$data:u.$data,$errors:u.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:s.$valid&&d.$valid,$data:s.$data.concat(d.$data),$errors:s.$errors.concat(d.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:n=>{let{$response:r}=n;return r?r.$errors.map(a=>Object.values(a).map(o=>o.map(s=>s.$message)).reduce((o,s)=>o.concat(s),[])):[]}}}const _=e=>{if(e=t.unref(e),Array.isArray(e))return!!e.length;if(e==null)return!1;if(e===!1)return!0;if(e instanceof Date)return!isNaN(e.getTime());if(typeof e=="object"){for(let n in e)return!0;return!1}return!!String(e).length},W=e=>(e=t.unref(e),Array.isArray(e)?e.length:typeof e=="object"?Object.keys(e).length:String(e).length);function C(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return a=>(a=t.unref(a),!_(a)||n.every(o=>(o.lastIndex=0,o.test(a))))}var K=Object.freeze({__proto__:null,forEach:lt,len:W,normalizeValidatorObject:D,regex:C,req:_,unwrap:t.unref,unwrapNormalizedValidator:O,unwrapValidatorResponse:E,withAsync:ct,withMessage:I,withParams:U}),ut=C(/^[a-zA-Z]*$/),dt={$validator:ut,$message:"The value is not alphabetical",$params:{type:"alpha"}},pt=C(/^[a-zA-Z0-9]*$/),mt={$validator:pt,$message:"The value must be alpha-numeric",$params:{type:"alphaNum"}},ft=C(/^\d*(\.\d+)?$/),$t={$validator:ft,$message:"Value must be numeric",$params:{type:"numeric"}};function gt(e,n){return r=>!_(r)||(!/\s/.test(r)||r instanceof Date)&&+t.unref(e)<=+r&&+t.unref(n)>=+r}function ht(e,n){return{$validator:gt(e,n),$message:r=>{let{$params:a}=r;return`The value must be between ${a.min} and ${a.max}`},$params:{min:e,max:n,type:"between"}}}const vt=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;var yt=C(vt),_t={$validator:yt,$message:"Value is not a valid email address",$params:{type:"email"}};function wt(e){if(!_(e))return!0;if(typeof e!="string")return!1;const n=e.split(".");return n.length===4&&n.every(bt)}const bt=e=>{if(e.length>3||e.length===0||e[0]==="0"&&e!=="0"||!e.match(/^\d+$/))return!1;const n=+e|0;return n>=0&&n<=255};var xt={$validator:wt,$message:"The value is not a valid IP address",$params:{type:"ipAddress"}};function Pt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:":";return n=>{if(e=t.unref(e),!_(n))return!0;if(typeof n!="string")return!1;const r=typeof e=="string"&&e!==""?n.split(e):n.length===12||n.length===16?n.match(/.{2}/g):null;return r!==null&&(r.length===6||r.length===8)&&r.every(Et)}}const Et=e=>e.toLowerCase().match(/^[0-9a-f]{2}$/);function Ct(e){return{$validator:Pt(e),$message:"The value is not a valid MAC Address",$params:{type:"macAddress"}}}function kt(e){return n=>!_(n)||W(n)<=t.unref(e)}function Rt(e){return{$validator:kt(e),$message:n=>{let{$params:r}=n;return`The maximum length allowed is ${r.max}`},$params:{max:e,type:"maxLength"}}}function Ot(e){return n=>!_(n)||W(n)>=t.unref(e)}function Vt(e){return{$validator:Ot(e),$message:n=>{let{$params:r}=n;return`This field should be at least ${r.min} characters long`},$params:{min:e,type:"minLength"}}}function Bt(e){return typeof e=="string"&&(e=e.trim()),_(e)}var X={$validator:Bt,$message:"Value is required",$params:{type:"required"}};const ae=(e,n)=>e?_(typeof n=="string"?n.trim():n):!0;function jt(e){return function(n,r){if(typeof e!="function")return ae(t.unref(e),n);const a=e.call(this,n,r);return ae(a,n)}}function It(e){return{$validator:jt(e),$message:"The value is required",$params:{type:"requiredIf",prop:e}}}const oe=(e,n)=>e?!0:_(typeof n=="string"?n.trim():n);function At(e){return function(n,r){if(typeof e!="function")return oe(t.unref(e),n);const a=e.call(this,n,r);return oe(a,n)}}function Tt(e){return{$validator:At(e),$message:"The value is required",$params:{type:"requiredUnless",prop:e}}}function Nt(e){return n=>t.unref(n)===t.unref(e)}function Lt(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"other";return{$validator:Nt(e),$message:r=>`The value must be equal to the ${n} value`,$params:{equalTo:e,otherName:n,type:"sameAs"}}}const St=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;var Dt=C(St),zt={$validator:Dt,$message:"The value is not a valid URL address",$params:{type:"url"}};function Mt(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce((o,s)=>E(o)?o:O(s).apply(this,r),!1)}}function Ft(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce(async(o,s)=>{const l=await o;return E(l)?l:O(s).apply(this,r)},Promise.resolve(!1))}}function qt(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];const a=n.some(l=>l.$async),o=n.reduce((l,c)=>c.$watchTargets?l.concat(c.$watchTargets):l,[]);let s=()=>!1;return n.length&&(s=a?Ft(n):Mt(n)),{$async:a,$validator:s,$watchTargets:o}}function Ht(){return U({type:"or"},I("The value does not match any of the provided validators",qt(...arguments)))}function Gt(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce((o,s)=>E(o)?O(s).apply(this,r):o,!0)}}function Ut(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce(async(o,s)=>{const l=await o;return E(l)?O(s).apply(this,r):l},Promise.resolve(!0))}}function Wt(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];const a=n.some(l=>l.$async),o=n.reduce((l,c)=>c.$watchTargets?l.concat(c.$watchTargets):l,[]);let s=()=>!1;return n.length&&(s=a?Ut(n):Gt(n)),{$async:a,$validator:s,$watchTargets:o}}function Kt(){return U({type:"and"},I("The value does not match all of the provided validators",Wt(...arguments)))}function Xt(e){return function(n,r){if(!_(n))return!0;const a=O(e).call(this,n,r);return it(a)?a.then(o=>!E(o)):!E(a)}}function Zt(e){return{$validator:Xt(e),$message:"The value does not match the provided validator",$params:{type:"not"}}}function Jt(e){return n=>!_(n)||(!/\s/.test(n)||n instanceof Date)&&+n>=+t.unref(e)}function Qt(e){return{$validator:Jt(e),$message:n=>{let{$params:r}=n;return`The minimum value allowed is ${r.min}`},$params:{min:e,type:"minValue"}}}function Yt(e){return n=>!_(n)||(!/\s/.test(n)||n instanceof Date)&&+n<=+t.unref(e)}var en=e=>({$validator:Yt(e),$message:n=>{let{$params:r}=n;return`The maximum value allowed is ${r.max}`},$params:{max:e,type:"maxValue"}}),tn=C(/(^[0-9]*$)|(^-[0-9]+$)/),nn={$validator:tn,$message:"Value is not an integer",$params:{type:"integer"}},rn=C(/^[-]?\d*(\.\d+)?$/),an={$validator:rn,$message:"Value must be decimal",$params:{type:"decimal"}};function on(e){let{t:n,messagePath:r=o=>{let{$validator:s}=o;return`validations.${s}`},messageParams:a=o=>o}=e;return function(s){let{withArguments:l=!1,messagePath:c=r,messageParams:d=a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};function u(p){return n(c(p),d(B({model:p.$model,property:p.$property,pending:p.$pending,invalid:p.$invalid,response:p.$response,validator:p.$validator,propertyPath:p.$propertyPath},p.$params)))}return l&&typeof s=="function"?function(){return I(u,s(...arguments))}:I(u,s)}}const ge=Object.freeze(Object.defineProperty({__proto__:null,alpha:dt,alphaNum:mt,and:Kt,between:ht,createI18nMessage:on,decimal:an,email:_t,helpers:K,integer:nn,ipAddress:xt,macAddress:Ct,maxLength:Rt,maxValue:en,minLength:Vt,minValue:Qt,not:Zt,numeric:$t,or:Ht,required:X,requiredIf:It,requiredUnless:Tt,sameAs:Lt,url:zt},Symbol.toStringTag,{value:"Module"}));function se(e){return["maxLength","minLength"].includes(e)}function sn(e,n){return{[e]:ge[e](n)}}function cn(e,n,r){return{[e]:K.withMessage(r,ge[e](n))}}function ln(){return{required:X}}function un(e){return{required:K.withMessage(e,X)}}function dn(e,n){if(se(e)&&typeof n.message=="string"&&typeof n.value=="number")return cn(e,n.value,n.message);if(se(e)&&typeof n.message>"u"&&typeof n.value=="number")return sn(e,n.value);if(e==="required"&&typeof n.message=="string")return un(n.message);if(e==="required"&&typeof n.message>"u")return ln();throw new Error("No valid rule detected")}const pn={key:0,class:"pdap-form-error-message"},mn=t.defineComponent({__name:"PdapForm",props:{error:{default:null},id:{},name:{},schema:{}},emits:["submit"],setup(e,{emit:n}){const r=e,a=n,o=t.ref(r.schema.reduce((d,u)=>{switch(u.type){case"checkbox":return{...d,[u.name]:u.defaultChecked};case"text":return{...d,[u.name]:u.value};default:return d}},{})),s=r.schema.reduce((d,u)=>{const p=Object.entries(u.validators??{}).reduce((f,[g,h])=>({...f,...dn(g,h)}),{});return{...d,[u.name]:{...p}}},{}),l=Ze(s,o,{$autoDirty:!1,$lazy:!1});t.watchEffect(()=>console.debug(`Hello from PDAP Form ${r.name} rendered at ${window.location.pathname}`,{props:r,values:o,rules:s,vuelidate:l.value}));async function c(d){const u=await l.value.$validate();if(u){const p=d.target,f=new FormData(p),g={};for(const[h,i]of f)Object.assign(g,{[h]:i});console.debug("Hello from Form's onSubmit handler",{values:g,isCorrectSubmission:u,vuelidate:l.value}),a("submit",g),l.value.$reset(),p.reset();return}else{console.error("is invalid form data",{v$:l.value});return}}return(d,u)=>(t.openBlock(),t.createElementBlock("form",{class:"pdap-form",onSubmit:u[0]||(u[0]=t.withModifiers(p=>c(p),["prevent"]))},[typeof d.error=="string"&&d.error.length>0?(t.openBlock(),t.createElementBlock("div",pn,t.toDisplayString(d.error),1)):t.createCommentVNode("",!0),t.createVNode(ot,t.normalizeProps(t.guardReactiveProps({schema:d.schema,values:o.value,...typeof t.unref(l)<"u"?{v$:t.unref(l)}:{}})),null,16),t.renderSlot(d.$slots,"default")],32))}});const fn=t.defineComponent({__name:"GridContainer",props:{columns:{default:"auto"},component:{default:"div"},rows:{default:"auto"},templateColumns:{},templateRows:{}},setup(e){const n=e,r=t.reactive({"pdap-grid-container":!0,[`pdap-grid-container-column-${n.columns}`]:n.columns!=="auto"}),a=n.templateRows||typeof n.rows=="number",o=n.templateRows??`repeat(${n.rows}, minmax(0, 1fr))`,s=t.reactive({...a&&{gridTemplateRows:o},...n.templateColumns&&{gridTemplateColumns:n.templateColumns}});return(l,c)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(l.component),{class:t.normalizeClass(r),style:t.normalizeStyle(s)},{default:t.withCtx(()=>[t.renderSlot(l.$slots,"default")]),_:3},8,["class","style"]))}});const $n=t.defineComponent({__name:"GridItem",props:{component:{default:"div"},spanColumn:{default:1},spanRow:{default:1}},setup(e){const n=e,r=t.reactive({"pdap-grid-item":!0,[`pdap-grid-item-span-column-${n.spanColumn}`]:n.spanColumn>1}),a=t.reactive({...n.spanRow>1&&{gridRow:`span ${n.spanRow} / span ${n.spanRow}`}});return(o,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.component),{class:t.normalizeClass(r),style:t.normalizeStyle(a)},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});const gn=t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},[t.createElementVNode("path",{d:"M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"})],-1),hn=[gn],vn=["aria-expanded"],yn=["href"],he=t.defineComponent({__name:"PdapNav",props:{topPosition:{}},setup(e){let n=t.inject("navLinks");typeof n>"u"&&(n=[],console.error(`Hey, PDAP developer
2
- `,"Did you forget to inject some linkData for the Nav component?"));const r=t.reactive({isExpanded:!1,isMobile:!0}),a=t.reactive({"pdap-nav":!0});t.onBeforeMount(()=>{o(),window.addEventListener("resize",o)}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",o)});async function o(){window.innerWidth<=1024?r.isMobile=!0:r.isMobile=!1,await t.nextTick()}async function s(){var c,d;const l=document.querySelector("body");!r.isExpanded&&r.isMobile?(r.isExpanded=!0,l!=null&&l.classList.contains("lock-scroll")||(c=document.querySelector("body"))==null||c.classList.add("lock-scroll")):r.isExpanded&&r.isMobile&&(r.isExpanded=!1,(d=document.querySelector("body"))==null||d.classList.remove("lock-scroll")),await t.nextTick()}return(l,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{"aria-controls":"nav",class:"pdap-nav-open-button",role:"button",onClick:s},hn),t.createElementVNode("nav",{id:"nav","aria-expanded":r.isMobile&&r.isExpanded||!r.isMobile,class:t.normalizeClass(a),style:t.normalizeStyle(r.isMobile?{top:`${l.topPosition}px`}:{})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(n),d=>(t.openBlock(),t.createElementBlock("li",{key:d.text,class:"pdap-nav-link-container"},[d.href?(t.openBlock(),t.createElementBlock("a",{key:0,class:"pdap-nav-link",href:d.href,target:"_blank",referrerpolicy:"no-referrer",onClick:s},t.toDisplayString(d.text),9,yn)):t.createCommentVNode("",!0),d.path?(t.openBlock(),t.createBlock(t.unref(ie.RouterLink),{key:1,"active-class":"pdap-nav-link-current","exact-active-class":"pdap-nav-link-current-exact",class:"pdap-nav-link",to:d.path,onClick:s},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(d.text),1)]),_:2},1032,["to"])):t.createCommentVNode("",!0)]))),128))],14,vn)],64))}});const _n=["href"],wn=["src"],bn=["src"],xn=t.defineComponent({__name:"PdapHeader",props:{logoImageSrc:{default:"node_modules/pdap-design-system/dist/images/lockup.svg"},logoImageAnchorPath:{default:"/"}},setup(e){const n=e,r=t.ref(),a=t.ref(null),o=n.logoImageAnchorPath.startsWith("/");t.onMounted(()=>{s(),window.addEventListener("resize",s)}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",s)});function s(){a.value&&(r.value=a.value.offsetHeight)}return(l,c)=>(t.openBlock(),t.createElementBlock("header",{ref_key:"el",ref:a,class:"pdap-header"},[t.unref(o)?(t.openBlock(),t.createBlock(t.unref(ie.RouterLink),{key:1,to:l.logoImageAnchorPath,class:"logo"},{default:t.withCtx(()=>[t.createElementVNode("img",{src:l.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,bn)]),_:1},8,["to"])):(t.openBlock(),t.createElementBlock("a",{key:0,href:l.logoImageAnchorPath,class:"logo"},[t.createElementVNode("img",{src:l.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,wn)],8,_n)),t.createVNode(he,{"top-position":r.value},null,8,["top-position"])],512))}});const Pn=["alt","src"],En=t.defineComponent({__name:"TileIcon",props:{imgAltText:{},imgSrc:{}},setup(e){return(n,r)=>(t.openBlock(),t.createElementBlock("img",{class:"pdap-tile-icon",alt:n.imgAltText,src:n.imgSrc},null,8,Pn))}});exports.Button=Ce;exports.FlexContainer=ce;exports.Footer=Le;exports.Form=mn;exports.GridContainer=fn;exports.GridItem=$n;exports.Header=xn;exports.Input=me;exports.InputCheckbox=$e;exports.InputText=fe;exports.Nav=he;exports.PdapInputTypes=L;exports.TileIcon=En;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),U=require("vue-router"),le=t.defineComponent({__name:"PdapButton",props:{intent:{default:"primary"},isLoading:{type:Boolean,default:!1}},setup(e){const n=e,r=t.reactive({"pdap-button":!0,[`pdap-button-${n.intent}`]:!!n.intent,"pdap-button-loading":n.isLoading});return(a,o)=>(t.openBlock(),t.createElementBlock("button",{class:t.normalizeClass(r)},[t.renderSlot(a.$slots,"default")],2))}});const W=t.defineComponent({__name:"FlexContainer",props:{alignment:{default:"start"},component:{default:"div"}},setup(e){const n=e,r=t.reactive({"pdap-flex-container":!0,[`pdap-flex-container-${n.alignment}`]:!0});return(a,o)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(a.component),{class:t.normalizeClass(r)},{default:t.withCtx(()=>[t.renderSlot(a.$slots,"default")]),_:3},8,["class"]))}});const Re={class:"pdap-footer"},Oe={class:"pdap-footer-social-links"},Ve=["href"],Be=t.createElementVNode("p",{class:"pdap-footer-copyright"},[t.createTextVNode(" © 2023 Police Data Accessibility Project"),t.createElementVNode("br")],-1),je=t.createElementVNode("p",{class:"pdap-footer-copyright"},[t.createTextVNode(" PDAP is a non-profit. EIN: 85-4207132. "),t.createElementVNode("a",{href:"https://docs.pdap.io/meta/policy/pdap-privacy-policy",alt:"Privacy Policy"}," Privacy Policy"),t.createTextVNode(". "),t.createElementVNode("a",{href:"mailto:contact@pdap.io"},"contact@pdap.io")],-1),Ie={class:"pdap-footer-widget-links"},Te=t.createElementVNode("a",{href:"https://www.guidestar.org/profile/85-4207132",target:"_blank"},[t.createElementVNode("img",{src:"https://widgets.guidestar.org/gximage2?o=9973356&l=v4"})],-1),Ae=["href"],Ne=["src"],Se=["src"],Le=t.defineComponent({__name:"PdapFooter",props:{logoImageSrc:{default:"node_modules/pdap-design-system/dist/images/acronym.svg"},logoImageAnchorPath:{default:"/"}},setup(e){const n=e,r=t.inject("footerLinks",[{href:"https://github.com/orgs/Police-Data-Accessibility-Project",text:"Github"},{href:"ttps://discord.gg/wMqex8nKZJ",text:"Discord"},{href:"https://www.linkedin.com/company/pdap",text:"LinkedIn"},{path:"/jobs",text:"Jobs"}]),a=n.logoImageAnchorPath.startsWith("/");return(o,s)=>{const i=t.resolveComponent("router-link");return t.openBlock(),t.createElementBlock("footer",Re,[t.createVNode(W,{alignment:"center"},{default:t.withCtx(()=>[t.createElementVNode("ul",Oe,[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(r),c=>(t.openBlock(),t.createElementBlock("li",{key:c.text,class:"pdap-footer-link-container"},[c.href?(t.openBlock(),t.createElementBlock("a",{key:0,class:"pdap-footer-social-link",href:c.href,target:"_blank",referrerpolicy:"no-referrer"},t.toDisplayString(c.text),9,Ve)):t.createCommentVNode("",!0),c.path?(t.openBlock(),t.createBlock(i,{key:1,"active-class":"pdap-footer-social-link-current","exact-active-class":"pdap-footer-social-link-current-exact",class:"pdap-footer-social-link",to:c.path},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(c.text),1)]),_:2},1032,["to"])):t.createCommentVNode("",!0)]))),128))]),Be,je,t.createElementVNode("div",Ie,[Te,t.unref(a)?(t.openBlock(),t.createBlock(i,{key:1,to:o.logoImageAnchorPath,class:"pdap-footer-logo"},{default:t.withCtx(()=>[t.createElementVNode("img",{src:o.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,Se)]),_:1},8,["to"])):(t.openBlock(),t.createElementBlock("a",{key:0,href:o.logoImageAnchorPath,class:"pdap-footer-logo"},[t.createElementVNode("img",{src:o.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,Ne)],8,Ae))])]),_:1})])}}});function Y(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function P(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?Y(Object(r),!0).forEach(function(a){De(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Y(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function De(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function ee(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return Object.keys(e).reduce((r,a)=>(n.includes(a)||(r[a]=t.unref(e[a])),r),{})}function S(e){return typeof e=="function"}function ze(e){return t.isReactive(e)||t.isReadonly(e)}function ue(e,n,r){let a=e;const o=n.split(".");for(let s=0;s<o.length;s++){if(!a[o[s]])return r;a=a[o[s]]}return a}function H(e,n,r){return t.computed(()=>e.some(a=>ue(n,a,{[r]:!1})[r]))}function te(e,n,r){return t.computed(()=>e.reduce((a,o)=>{const s=ue(n,o,{[r]:!1})[r]||[];return a.concat(s)},[]))}function de(e,n,r,a){return e.call(a,t.unref(n),t.unref(r),a)}function pe(e){return e.$valid!==void 0?!e.$valid:!e}function Me(e,n,r,a,o,s,i){let{$lazy:c,$rewardEarly:d}=o,u=arguments.length>7&&arguments[7]!==void 0?arguments[7]:[],p=arguments.length>8?arguments[8]:void 0,f=arguments.length>9?arguments[9]:void 0,h=arguments.length>10?arguments[10]:void 0;const g=t.ref(!!a.value),l=t.ref(0);r.value=!1;const m=t.watch([n,a].concat(u,h),()=>{if(c&&!a.value||d&&!f.value&&!r.value)return;let $;try{$=de(e,n,p,i)}catch(v){$=Promise.reject(v)}l.value++,r.value=!!l.value,g.value=!1,Promise.resolve($).then(v=>{l.value--,r.value=!!l.value,s.value=v,g.value=pe(v)}).catch(v=>{l.value--,r.value=!!l.value,s.value=v,g.value=!0})},{immediate:!0,deep:typeof n=="object"});return{$invalid:g,$unwatch:m}}function Fe(e,n,r,a,o,s,i,c){let{$lazy:d,$rewardEarly:u}=a;const p=()=>({}),f=t.computed(()=>{if(d&&!r.value||u&&!c.value)return!1;let h=!0;try{const g=de(e,n,i,s);o.value=g,h=pe(g)}catch(g){o.value=g}return h});return{$unwatch:p,$invalid:f}}function qe(e,n,r,a,o,s,i,c,d,u,p){const f=t.ref(!1),h=e.$params||{},g=t.ref(null);let l,m;e.$async?{$invalid:l,$unwatch:m}=Me(e.$validator,n,f,r,a,g,o,e.$watchTargets,d,u,p):{$invalid:l,$unwatch:m}=Fe(e.$validator,n,r,a,g,o,d,u);const $=e.$message;return{$message:S($)?t.computed(()=>$(ee({$pending:f,$invalid:l,$params:ee(h),$model:n,$response:g,$validator:s,$propertyPath:c,$property:i}))):$||"",$params:h,$pending:f,$invalid:l,$response:g,$unwatch:m}}function He(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const n=t.unref(e),r=Object.keys(n),a={},o={},s={};let i=null;return r.forEach(c=>{const d=n[c];switch(!0){case S(d.$validator):a[c]=d;break;case S(d):a[c]={$validator:d};break;case c==="$validationGroups":i=d;break;case c.startsWith("$"):s[c]=d;break;default:o[c]=d}}),{rules:a,nestedValidators:o,config:s,validationGroups:i}}const Ge="__root";function Ue(e,n,r,a,o,s,i,c,d){const u=Object.keys(e),p=a.get(o,e),f=t.ref(!1),h=t.ref(!1),g=t.ref(0);if(p){if(!p.$partial)return p;p.$unwatch(),f.value=p.$dirty.value}const l={$dirty:f,$path:o,$touch:()=>{f.value||(f.value=!0)},$reset:()=>{f.value&&(f.value=!1)},$commit:()=>{}};return u.length?(u.forEach(m=>{l[m]=qe(e[m],n,l.$dirty,s,i,m,r,o,d,h,g)}),l.$externalResults=t.computed(()=>c.value?[].concat(c.value).map((m,$)=>({$propertyPath:o,$property:r,$validator:"$externalResults",$uid:`${o}-externalResult-${$}`,$message:m,$params:{},$response:null,$pending:!1})):[]),l.$invalid=t.computed(()=>{const m=u.some($=>t.unref(l[$].$invalid));return h.value=m,!!l.$externalResults.value.length||m}),l.$pending=t.computed(()=>u.some(m=>t.unref(l[m].$pending))),l.$error=t.computed(()=>l.$dirty.value?l.$pending.value||l.$invalid.value:!1),l.$silentErrors=t.computed(()=>u.filter(m=>t.unref(l[m].$invalid)).map(m=>{const $=l[m];return t.reactive({$propertyPath:o,$property:r,$validator:m,$uid:`${o}-${m}`,$message:$.$message,$params:$.$params,$response:$.$response,$pending:$.$pending})}).concat(l.$externalResults.value)),l.$errors=t.computed(()=>l.$dirty.value?l.$silentErrors.value:[]),l.$unwatch=()=>u.forEach(m=>{l[m].$unwatch()}),l.$commit=()=>{h.value=!0,g.value=Date.now()},a.set(o,e,l),l):(p&&a.set(o,e,l),l)}function We(e,n,r,a,o,s,i){const c=Object.keys(e);return c.length?c.reduce((d,u)=>(d[u]=G({validations:e[u],state:n,key:u,parentKey:r,resultsCache:a,globalConfig:o,instance:s,externalResults:i}),d),{}):{}}function Xe(e,n,r){const a=t.computed(()=>[n,r].filter(l=>l).reduce((l,m)=>l.concat(Object.values(t.unref(m))),[])),o=t.computed({get(){return e.$dirty.value||(a.value.length?a.value.every(l=>l.$dirty):!1)},set(l){e.$dirty.value=l}}),s=t.computed(()=>{const l=t.unref(e.$silentErrors)||[],m=a.value.filter($=>(t.unref($).$silentErrors||[]).length).reduce(($,v)=>$.concat(...v.$silentErrors),[]);return l.concat(m)}),i=t.computed(()=>{const l=t.unref(e.$errors)||[],m=a.value.filter($=>(t.unref($).$errors||[]).length).reduce(($,v)=>$.concat(...v.$errors),[]);return l.concat(m)}),c=t.computed(()=>a.value.some(l=>l.$invalid)||t.unref(e.$invalid)||!1),d=t.computed(()=>a.value.some(l=>t.unref(l.$pending))||t.unref(e.$pending)||!1),u=t.computed(()=>a.value.some(l=>l.$dirty)||a.value.some(l=>l.$anyDirty)||o.value),p=t.computed(()=>o.value?d.value||c.value:!1),f=()=>{e.$touch(),a.value.forEach(l=>{l.$touch()})},h=()=>{e.$commit(),a.value.forEach(l=>{l.$commit()})},g=()=>{e.$reset(),a.value.forEach(l=>{l.$reset()})};return a.value.length&&a.value.every(l=>l.$dirty)&&f(),{$dirty:o,$errors:i,$invalid:c,$anyDirty:u,$error:p,$pending:d,$touch:f,$reset:g,$silentErrors:s,$commit:h}}function G(e){let{validations:n,state:r,key:a,parentKey:o,childResults:s,resultsCache:i,globalConfig:c={},instance:d,externalResults:u}=e;const p=o?`${o}.${a}`:a,{rules:f,nestedValidators:h,config:g,validationGroups:l}=He(n),m=P(P({},c),g),$=a?t.computed(()=>{const y=t.unref(r);return y?t.unref(y[a]):void 0}):r,v=P({},t.unref(u)||{}),V=t.computed(()=>{const y=t.unref(u);return a?y?t.unref(y[a]):void 0:y}),z=Ue(f,$,a,i,p,m,d,V,r),w=We(h,$,p,i,m,d,V),k={};l&&Object.entries(l).forEach(y=>{let[R,x]=y;k[R]={$invalid:H(x,w,"$invalid"),$error:H(x,w,"$error"),$pending:H(x,w,"$pending"),$errors:te(x,w,"$errors"),$silentErrors:te(x,w,"$silentErrors")}});const{$dirty:b,$errors:A,$invalid:M,$anyDirty:_e,$error:we,$pending:F,$touch:q,$reset:be,$silentErrors:xe,$commit:J}=Xe(z,w,s),Pe=a?t.computed({get:()=>t.unref($),set:y=>{b.value=!0;const R=t.unref(r),x=t.unref(u);x&&(x[a]=v[a]),t.isRef(R[a])?R[a].value=y:R[a]=y}}):null;a&&m.$autoDirty&&t.watch($,()=>{b.value||q();const y=t.unref(u);y&&(y[a]=v[a])},{flush:"sync"});async function Ee(){return q(),m.$rewardEarly&&(J(),await t.nextTick()),await t.nextTick(),new Promise(y=>{if(!F.value)return y(!M.value);const R=t.watch(F,()=>{y(!M.value),R()})})}function Ce(y){return(s.value||{})[y]}function ke(){t.isRef(u)?u.value=v:Object.keys(v).length===0?Object.keys(u).forEach(y=>{delete u[y]}):Object.assign(u,v)}return t.reactive(P(P(P({},z),{},{$model:Pe,$dirty:b,$error:we,$errors:A,$invalid:M,$anyDirty:_e,$pending:F,$touch:q,$reset:be,$path:p||Ge,$silentErrors:xe,$validate:Ee,$commit:J},s&&{$getResultsForChild:Ce,$clearExternalResults:ke,$validationGroups:k}),w))}class Ke{constructor(){this.storage=new Map}set(n,r,a){this.storage.set(n,{rules:r,result:a})}checkRulesValidity(n,r,a){const o=Object.keys(a),s=Object.keys(r);return s.length!==o.length||!s.every(c=>o.includes(c))?!1:s.every(c=>r[c].$params?Object.keys(r[c].$params).every(d=>t.unref(a[c].$params[d])===t.unref(r[c].$params[d])):!0)}get(n,r){const a=this.storage.get(n);if(!a)return;const{rules:o,result:s}=a,i=this.checkRulesValidity(n,r,o),c=s.$unwatch?s.$unwatch:()=>({});return i?s:{$dirty:s.$dirty,$partial:!0,$unwatch:c}}}const N={COLLECT_ALL:!0,COLLECT_NONE:!1},ne=Symbol("vuelidate#injectChildResults"),re=Symbol("vuelidate#removeChildResults");function Qe(e){let{$scope:n,instance:r}=e;const a={},o=t.ref([]),s=t.computed(()=>o.value.reduce((p,f)=>(p[f]=t.unref(a[f]),p),{}));function i(p,f){let{$registerAs:h,$scope:g,$stopPropagation:l}=f;l||n===N.COLLECT_NONE||g===N.COLLECT_NONE||n!==N.COLLECT_ALL&&n!==g||(a[h]=p,o.value.push(h))}r.__vuelidateInjectInstances=[].concat(r.__vuelidateInjectInstances||[],i);function c(p){o.value=o.value.filter(f=>f!==p),delete a[p]}r.__vuelidateRemoveInstances=[].concat(r.__vuelidateRemoveInstances||[],c);const d=t.inject(ne,[]);t.provide(ne,r.__vuelidateInjectInstances);const u=t.inject(re,[]);return t.provide(re,r.__vuelidateRemoveInstances),{childResults:s,sendValidationResultsToParent:d,removeValidationResultsFromParent:u}}function me(e){return new Proxy(e,{get(n,r){return typeof n[r]=="object"?me(n[r]):t.computed(()=>n[r])}})}let ae=0;function Ze(e,n){var r;let a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};arguments.length===1&&(a=e,e=void 0,n=void 0);let{$registerAs:o,$scope:s=N.COLLECT_ALL,$stopPropagation:i,$externalResults:c,currentVueInstance:d}=a;const u=d||((r=t.getCurrentInstance())===null||r===void 0?void 0:r.proxy),p=u?u.$options:{};o||(ae+=1,o=`_vuelidate_${ae}`);const f=t.ref({}),h=new Ke,{childResults:g,sendValidationResultsToParent:l,removeValidationResultsFromParent:m}=u?Qe({$scope:s,instance:u}):{childResults:t.ref({})};if(!e&&p.validations){const $=p.validations;n=t.ref({}),t.onBeforeMount(()=>{n.value=u,t.watch(()=>S($)?$.call(n.value,new me(n.value)):$,v=>{f.value=G({validations:v,state:n,childResults:g,resultsCache:h,globalConfig:a,instance:u,externalResults:c||u.vuelidateExternalResults})},{immediate:!0})}),a=p.validationsConfig||a}else{const $=t.isRef(e)||ze(e)?e:t.reactive(e||{});t.watch($,v=>{f.value=G({validations:v,state:n,childResults:g,resultsCache:h,globalConfig:a,instance:u??{},externalResults:c})},{immediate:!0})}return u&&(l.forEach($=>$(f,{$registerAs:o,$scope:s,$stopPropagation:i})),t.onBeforeUnmount(()=>m.forEach($=>$(o)))),t.computed(()=>P(P({},t.unref(f.value)),g.value))}const Je=["for"],Ye=["id"],fe=t.defineComponent({__name:"PdapInput",props:{id:{},label:{},name:{},error:{}},setup(e){const n=e,r=t.computed(()=>`pdap-${n.name}-input-error`);return t.watchEffect(()=>{console.debug(`Hello from PDAP Input ${n.name} rendered at ${window.location.pathname}`,{props:n})}),(a,o)=>{var s;return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass({"pdap-input":!0,"pdap-input-error":((s=a.error)==null?void 0:s.length)>=1})},[t.renderSlot(a.$slots,"default"),t.createElementVNode("label",{class:"pdap-input-label",for:a.id},t.toDisplayString(a.label),9,Je),a.error?(t.openBlock(),t.createElementBlock("div",{key:0,id:r.value,class:"pdap-input-error-message"},t.toDisplayString(a.error),9,Ye)):t.createCommentVNode("",!0)],2)}}});const et=["id","name","value","placeholder"],$e=t.defineComponent({__name:"InputText",props:{placeholder:{},type:{},value:{},id:{},label:{},name:{},error:{}},emits:["input"],setup(e,{emit:n}){const r=e,a=n,o=s=>{a("input",s.target.value)};return t.watchEffect(()=>{console.debug(`Hello from PDAP InputText ${r.name} rendered at ${window.location.pathname}`,{props:r})}),(s,i)=>(t.openBlock(),t.createElementBlock("input",{id:s.id,type:"text",name:s.name,value:s.value,placeholder:s.placeholder,onInput:o},null,40,et))}}),tt=["id","name","checked","value"],he=t.defineComponent({__name:"InputCheckbox",props:{defaultChecked:{type:Boolean},type:{},value:{},id:{},label:{},name:{},error:{}},emits:["change"],setup(e,{emit:n}){const r=e,a=n,o=s=>{a("change",s.target.checked.toString())};return t.watchEffect(()=>{console.debug(`Hello from PDAP InputCheckbox ${r.name} rendered at ${window.location.pathname}`,{props:r})}),(s,i)=>(t.openBlock(),t.createElementBlock("input",{id:s.id,class:"pdap-input-checkbox",name:s.name,checked:s.defaultChecked,value:s.value,type:"checkbox",onChange:o},null,40,tt))}});var B=(e=>(e.CHECKBOX="checkbox",e.TEXT="text",e))(B||{});const nt={[B.CHECKBOX]:"InputCheckbox",[B.TEXT]:"InputText"},rt={name:"InputsGenerator",components:{InputText:$e,InputCheckbox:he,PdapInput:fe},props:{schema:{type:Object},values:{type:Object},v$:{type:Object}},emits:["blur","input"],setup(e,{emit:n}){n("input"),n("blur")},data(){return{formData:this.values||{},INPUT_COMPONENT_MAP:nt,v:this.$props.v$}},methods:{updateForm(e,n){this.formData[e]=n,this.$emit("input",this.formData)},updateValidations(e){var n,r;(r=(n=this.v$)==null?void 0:n.value)==null||r[e].$touch}}},at=(e,n)=>{const r=e.__vccOpts||e;for(const[a,o]of n)r[a]=o;return r};function ot(e,n,r,a,o,s){const i=t.resolveComponent("PdapInput");return t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(r.schema,c=>{var d,u,p,f;return t.openBlock(),t.createBlock(i,{id:c.id,key:c.name,error:(f=(p=(u=(d=o.v)==null?void 0:d[c.name])==null?void 0:u.$errors)==null?void 0:p[0])==null?void 0:f.$message,name:c.name,label:c.label},{default:t.withCtx(()=>[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.INPUT_COMPONENT_MAP[c.type]),t.mergeProps(c,{value:o.formData[c.name],onBlur:h=>s.updateValidations(c.name),onInput:h=>s.updateForm(c.name,h)}),null,16,["value","onBlur","onInput"]))]),_:2},1032,["id","error","name","label"])}),128)}const st=at(rt,[["render",ot]]);function oe(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,a)}return r}function j(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?oe(Object(r),!0).forEach(function(a){it(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):oe(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}function it(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function I(e){return typeof e=="function"}function L(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function D(e){return I(e.$validator)?j({},e):{$validator:e}}function ct(e){return L(e)&&I(e.then)}function E(e){return typeof e=="object"?e.$valid:e}function O(e){return e.$validator||e}function X(e,n){if(!L(e))throw new Error(`[@vuelidate/validators]: First parameter to "withParams" should be an object, provided ${typeof e}`);if(!L(n)&&!I(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const r=D(n);return r.$params=j(j({},r.$params||{}),e),r}function T(e,n){if(!I(e)&&typeof t.unref(e)!="string")throw new Error(`[@vuelidate/validators]: First parameter to "withMessage" should be string or a function returning a string, provided ${typeof e}`);if(!L(n)&&!I(n))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const r=D(n);return r.$message=e,r}function lt(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];const r=D(e);return j(j({},r),{},{$async:!0,$watchTargets:n})}function ut(e){return{$validator(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return t.unref(n).reduce((s,i,c)=>{const d=Object.entries(i).reduce((u,p)=>{let[f,h]=p;const g=e[f]||{},l=Object.entries(g).reduce((m,$)=>{let[v,V]=$;const w=O(V).call(this,h,i,c,...a),k=E(w);if(m.$data[v]=w,m.$data.$invalid=!k||!!m.$data.$invalid,m.$data.$error=m.$data.$invalid,!k){let b=V.$message||"";const A=V.$params||{};typeof b=="function"&&(b=b({$pending:!1,$invalid:!k,$params:A,$model:h,$response:w})),m.$errors.push({$property:f,$message:b,$params:A,$response:w,$model:h,$pending:!1,$validator:v})}return{$valid:m.$valid&&k,$data:m.$data,$errors:m.$errors}},{$valid:!0,$data:{},$errors:[]});return u.$data[f]=l.$data,u.$errors[f]=l.$errors,{$valid:u.$valid&&l.$valid,$data:u.$data,$errors:u.$errors}},{$valid:!0,$data:{},$errors:{}});return{$valid:s.$valid&&d.$valid,$data:s.$data.concat(d.$data),$errors:s.$errors.concat(d.$errors)}},{$valid:!0,$data:[],$errors:[]})},$message:n=>{let{$response:r}=n;return r?r.$errors.map(a=>Object.values(a).map(o=>o.map(s=>s.$message)).reduce((o,s)=>o.concat(s),[])):[]}}}const _=e=>{if(e=t.unref(e),Array.isArray(e))return!!e.length;if(e==null)return!1;if(e===!1)return!0;if(e instanceof Date)return!isNaN(e.getTime());if(typeof e=="object"){for(let n in e)return!0;return!1}return!!String(e).length},K=e=>(e=t.unref(e),Array.isArray(e)?e.length:typeof e=="object"?Object.keys(e).length:String(e).length);function C(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return a=>(a=t.unref(a),!_(a)||n.every(o=>(o.lastIndex=0,o.test(a))))}var Q=Object.freeze({__proto__:null,forEach:ut,len:K,normalizeValidatorObject:D,regex:C,req:_,unwrap:t.unref,unwrapNormalizedValidator:O,unwrapValidatorResponse:E,withAsync:lt,withMessage:T,withParams:X}),dt=C(/^[a-zA-Z]*$/),pt={$validator:dt,$message:"The value is not alphabetical",$params:{type:"alpha"}},mt=C(/^[a-zA-Z0-9]*$/),ft={$validator:mt,$message:"The value must be alpha-numeric",$params:{type:"alphaNum"}},$t=C(/^\d*(\.\d+)?$/),ht={$validator:$t,$message:"Value must be numeric",$params:{type:"numeric"}};function gt(e,n){return r=>!_(r)||(!/\s/.test(r)||r instanceof Date)&&+t.unref(e)<=+r&&+t.unref(n)>=+r}function vt(e,n){return{$validator:gt(e,n),$message:r=>{let{$params:a}=r;return`The value must be between ${a.min} and ${a.max}`},$params:{min:e,max:n,type:"between"}}}const yt=/^(?:[A-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[A-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9]{2,}(?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i;var _t=C(yt),wt={$validator:_t,$message:"Value is not a valid email address",$params:{type:"email"}};function bt(e){if(!_(e))return!0;if(typeof e!="string")return!1;const n=e.split(".");return n.length===4&&n.every(xt)}const xt=e=>{if(e.length>3||e.length===0||e[0]==="0"&&e!=="0"||!e.match(/^\d+$/))return!1;const n=+e|0;return n>=0&&n<=255};var Pt={$validator:bt,$message:"The value is not a valid IP address",$params:{type:"ipAddress"}};function Et(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:":";return n=>{if(e=t.unref(e),!_(n))return!0;if(typeof n!="string")return!1;const r=typeof e=="string"&&e!==""?n.split(e):n.length===12||n.length===16?n.match(/.{2}/g):null;return r!==null&&(r.length===6||r.length===8)&&r.every(Ct)}}const Ct=e=>e.toLowerCase().match(/^[0-9a-f]{2}$/);function kt(e){return{$validator:Et(e),$message:"The value is not a valid MAC Address",$params:{type:"macAddress"}}}function Rt(e){return n=>!_(n)||K(n)<=t.unref(e)}function Ot(e){return{$validator:Rt(e),$message:n=>{let{$params:r}=n;return`The maximum length allowed is ${r.max}`},$params:{max:e,type:"maxLength"}}}function Vt(e){return n=>!_(n)||K(n)>=t.unref(e)}function Bt(e){return{$validator:Vt(e),$message:n=>{let{$params:r}=n;return`This field should be at least ${r.min} characters long`},$params:{min:e,type:"minLength"}}}function jt(e){return typeof e=="string"&&(e=e.trim()),_(e)}var Z={$validator:jt,$message:"Value is required",$params:{type:"required"}};const se=(e,n)=>e?_(typeof n=="string"?n.trim():n):!0;function It(e){return function(n,r){if(typeof e!="function")return se(t.unref(e),n);const a=e.call(this,n,r);return se(a,n)}}function Tt(e){return{$validator:It(e),$message:"The value is required",$params:{type:"requiredIf",prop:e}}}const ie=(e,n)=>e?!0:_(typeof n=="string"?n.trim():n);function At(e){return function(n,r){if(typeof e!="function")return ie(t.unref(e),n);const a=e.call(this,n,r);return ie(a,n)}}function Nt(e){return{$validator:At(e),$message:"The value is required",$params:{type:"requiredUnless",prop:e}}}function St(e){return n=>t.unref(n)===t.unref(e)}function Lt(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"other";return{$validator:St(e),$message:r=>`The value must be equal to the ${n} value`,$params:{equalTo:e,otherName:n,type:"sameAs"}}}const Dt=/^(?:(?:(?:https?|ftp):)?\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u00a1-\uffff][a-z0-9\u00a1-\uffff_-]{0,62})?[a-z0-9\u00a1-\uffff]\.)+(?:[a-z\u00a1-\uffff]{2,}\.?))(?::\d{2,5})?(?:[/?#]\S*)?$/i;var zt=C(Dt),Mt={$validator:zt,$message:"The value is not a valid URL address",$params:{type:"url"}};function Ft(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce((o,s)=>E(o)?o:O(s).apply(this,r),!1)}}function qt(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce(async(o,s)=>{const i=await o;return E(i)?i:O(s).apply(this,r)},Promise.resolve(!1))}}function Ht(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];const a=n.some(i=>i.$async),o=n.reduce((i,c)=>c.$watchTargets?i.concat(c.$watchTargets):i,[]);let s=()=>!1;return n.length&&(s=a?qt(n):Ft(n)),{$async:a,$validator:s,$watchTargets:o}}function Gt(){return X({type:"or"},T("The value does not match any of the provided validators",Ht(...arguments)))}function Ut(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce((o,s)=>E(o)?O(s).apply(this,r):o,!0)}}function Wt(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return e.reduce(async(o,s)=>{const i=await o;return E(i)?O(s).apply(this,r):i},Promise.resolve(!0))}}function Xt(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];const a=n.some(i=>i.$async),o=n.reduce((i,c)=>c.$watchTargets?i.concat(c.$watchTargets):i,[]);let s=()=>!1;return n.length&&(s=a?Wt(n):Ut(n)),{$async:a,$validator:s,$watchTargets:o}}function Kt(){return X({type:"and"},T("The value does not match all of the provided validators",Xt(...arguments)))}function Qt(e){return function(n,r){if(!_(n))return!0;const a=O(e).call(this,n,r);return ct(a)?a.then(o=>!E(o)):!E(a)}}function Zt(e){return{$validator:Qt(e),$message:"The value does not match the provided validator",$params:{type:"not"}}}function Jt(e){return n=>!_(n)||(!/\s/.test(n)||n instanceof Date)&&+n>=+t.unref(e)}function Yt(e){return{$validator:Jt(e),$message:n=>{let{$params:r}=n;return`The minimum value allowed is ${r.min}`},$params:{min:e,type:"minValue"}}}function en(e){return n=>!_(n)||(!/\s/.test(n)||n instanceof Date)&&+n<=+t.unref(e)}var tn=e=>({$validator:en(e),$message:n=>{let{$params:r}=n;return`The maximum value allowed is ${r.max}`},$params:{max:e,type:"maxValue"}}),nn=C(/(^[0-9]*$)|(^-[0-9]+$)/),rn={$validator:nn,$message:"Value is not an integer",$params:{type:"integer"}},an=C(/^[-]?\d*(\.\d+)?$/),on={$validator:an,$message:"Value must be decimal",$params:{type:"decimal"}};function sn(e){let{t:n,messagePath:r=o=>{let{$validator:s}=o;return`validations.${s}`},messageParams:a=o=>o}=e;return function(s){let{withArguments:i=!1,messagePath:c=r,messageParams:d=a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};function u(p){return n(c(p),d(j({model:p.$model,property:p.$property,pending:p.$pending,invalid:p.$invalid,response:p.$response,validator:p.$validator,propertyPath:p.$propertyPath},p.$params)))}return i&&typeof s=="function"?function(){return T(u,s(...arguments))}:T(u,s)}}const ge=Object.freeze(Object.defineProperty({__proto__:null,alpha:pt,alphaNum:ft,and:Kt,between:vt,createI18nMessage:sn,decimal:on,email:wt,helpers:Q,integer:rn,ipAddress:Pt,macAddress:kt,maxLength:Ot,maxValue:tn,minLength:Bt,minValue:Yt,not:Zt,numeric:ht,or:Gt,required:Z,requiredIf:Tt,requiredUnless:Nt,sameAs:Lt,url:Mt},Symbol.toStringTag,{value:"Module"}));function ce(e){return["maxLength","minLength"].includes(e)}function cn(e,n){return{[e]:ge[e](n)}}function ln(e,n,r){return{[e]:Q.withMessage(r,ge[e](n))}}function un(){return{required:Z}}function dn(e){return{required:Q.withMessage(e,Z)}}function pn(e,n){if(ce(e)&&typeof n.message=="string"&&typeof n.value=="number")return ln(e,n.value,n.message);if(ce(e)&&typeof n.message>"u"&&typeof n.value=="number")return cn(e,n.value);if(e==="required"&&typeof n.message=="string")return dn(n.message);if(e==="required"&&typeof n.message>"u")return un();throw new Error("No valid rule detected")}const mn={key:0,class:"pdap-form-error-message"},ve=t.defineComponent({__name:"PdapForm",props:{error:{default:null},id:{},name:{},schema:{}},emits:["submit"],setup(e,{emit:n}){const r=e,a=n,o=t.ref(r.schema.reduce((d,u)=>{switch(u.type){case"checkbox":return{...d,[u.name]:u.defaultChecked};case"text":return{...d,[u.name]:u.value};default:return d}},{})),s=r.schema.reduce((d,u)=>{const p=Object.entries(u.validators??{}).reduce((f,[h,g])=>({...f,...pn(h,g)}),{});return{...d,[u.name]:{...p}}},{}),i=Ze(s,o,{$autoDirty:!1,$lazy:!1});t.watchEffect(()=>console.debug(`Hello from PDAP Form ${r.name} rendered at ${window.location.pathname}`,{props:r,values:o,rules:s,vuelidate:i.value}));async function c(d){const u=await i.value.$validate();if(u){const p=d.target,f=new FormData(p),h={};for(const[g,l]of f)Object.assign(h,{[g]:l});console.debug("Hello from Form's onSubmit handler",{values:h,isCorrectSubmission:u,vuelidate:i.value}),a("submit",h),i.value.$reset(),p.reset();return}else{console.error("is invalid form data",{v$:i.value});return}}return(d,u)=>(t.openBlock(),t.createElementBlock("form",{class:"pdap-form",onSubmit:u[0]||(u[0]=t.withModifiers(p=>c(p),["prevent"]))},[typeof d.error=="string"&&d.error.length>0?(t.openBlock(),t.createElementBlock("div",mn,t.toDisplayString(d.error),1)):t.createCommentVNode("",!0),t.createVNode(st,t.normalizeProps(t.guardReactiveProps({schema:d.schema,values:o.value,...typeof t.unref(i)<"u"?{v$:t.unref(i)}:{}})),null,16),t.renderSlot(d.$slots,"default")],32))}});const fn=t.defineComponent({__name:"GridContainer",props:{columns:{default:"auto"},component:{default:"div"},rows:{default:"auto"},templateColumns:{},templateRows:{}},setup(e){const n=e,r=t.reactive({"pdap-grid-container":!0,[`pdap-grid-container-column-${n.columns}`]:n.columns!=="auto"}),a=n.templateRows||typeof n.rows=="number",o=n.templateRows??`repeat(${n.rows}, minmax(0, 1fr))`,s=t.reactive({...a&&{gridTemplateRows:o},...n.templateColumns&&{gridTemplateColumns:n.templateColumns}});return(i,c)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(i.component),{class:t.normalizeClass(r),style:t.normalizeStyle(s)},{default:t.withCtx(()=>[t.renderSlot(i.$slots,"default")]),_:3},8,["class","style"]))}});const $n=t.defineComponent({__name:"GridItem",props:{component:{default:"div"},spanColumn:{default:1},spanRow:{default:1}},setup(e){const n=e,r=t.reactive({"pdap-grid-item":!0,[`pdap-grid-item-span-column-${n.spanColumn}`]:n.spanColumn>1}),a=t.reactive({...n.spanRow>1&&{gridRow:`span ${n.spanRow} / span ${n.spanRow}`}});return(o,s)=>(t.openBlock(),t.createBlock(t.resolveDynamicComponent(o.component),{class:t.normalizeClass(r),style:t.normalizeStyle(a)},{default:t.withCtx(()=>[t.renderSlot(o.$slots,"default")]),_:3},8,["class","style"]))}});const hn=t.createElementVNode("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512"},[t.createElementVNode("path",{d:"M0 96C0 78.3 14.3 64 32 64H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32C14.3 128 0 113.7 0 96zM0 256c0-17.7 14.3-32 32-32H416c17.7 0 32 14.3 32 32s-14.3 32-32 32H32c-17.7 0-32-14.3-32-32zM448 416c0 17.7-14.3 32-32 32H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H416c17.7 0 32 14.3 32 32z"})],-1),gn=[hn],vn=["aria-expanded"],yn=["href"],ye=t.defineComponent({__name:"PdapNav",props:{topPosition:{}},setup(e){let n=t.inject("navLinks");typeof n>"u"&&(n=[],console.error(`Hey, PDAP developer
2
+ `,"Did you forget to inject some linkData for the Nav component?"));const r=t.reactive({isExpanded:!1,isMobile:!0}),a=t.reactive({"pdap-nav":!0});t.onBeforeMount(()=>{o(),window.addEventListener("resize",o)}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",o)});async function o(){window.innerWidth<=1024?r.isMobile=!0:r.isMobile=!1,await t.nextTick()}async function s(){var c,d;const i=document.querySelector("body");!r.isExpanded&&r.isMobile?(r.isExpanded=!0,i!=null&&i.classList.contains("lock-scroll")||(c=document.querySelector("body"))==null||c.classList.add("lock-scroll")):r.isExpanded&&r.isMobile&&(r.isExpanded=!1,(d=document.querySelector("body"))==null||d.classList.remove("lock-scroll")),await t.nextTick()}return(i,c)=>(t.openBlock(),t.createElementBlock(t.Fragment,null,[t.createElementVNode("div",{"aria-controls":"nav",class:"pdap-nav-open-button",role:"button",onClick:s},gn),t.createElementVNode("nav",{id:"nav","aria-expanded":r.isMobile&&r.isExpanded||!r.isMobile,class:t.normalizeClass(a),style:t.normalizeStyle(r.isMobile?{top:`${i.topPosition}px`}:{})},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(t.unref(n),d=>(t.openBlock(),t.createElementBlock("li",{key:d.text,class:"pdap-nav-link-container"},[d.href?(t.openBlock(),t.createElementBlock("a",{key:0,class:"pdap-nav-link",href:d.href,target:"_blank",referrerpolicy:"no-referrer",onClick:s},t.toDisplayString(d.text),9,yn)):t.createCommentVNode("",!0),d.path?(t.openBlock(),t.createBlock(t.unref(U.RouterLink),{key:1,"active-class":"pdap-nav-link-current","exact-active-class":"pdap-nav-link-current-exact",class:"pdap-nav-link",to:d.path,onClick:s},{default:t.withCtx(()=>[t.createTextVNode(t.toDisplayString(d.text),1)]),_:2},1032,["to"])):t.createCommentVNode("",!0)]))),128))],14,vn)],64))}});const _n=["href"],wn=["src"],bn=["src"],xn=t.defineComponent({__name:"PdapHeader",props:{logoImageSrc:{default:"node_modules/pdap-design-system/dist/images/lockup.svg"},logoImageAnchorPath:{default:"/"}},setup(e){const n=e,r=t.ref(),a=t.ref(null),o=n.logoImageAnchorPath.startsWith("/");t.onMounted(()=>{s(),window.addEventListener("resize",s)}),t.onBeforeUnmount(()=>{window.removeEventListener("resize",s)});function s(){a.value&&(r.value=a.value.offsetHeight)}return(i,c)=>(t.openBlock(),t.createElementBlock("header",{ref_key:"el",ref:a,class:"pdap-header"},[t.unref(o)?(t.openBlock(),t.createBlock(t.unref(U.RouterLink),{key:1,to:i.logoImageAnchorPath,class:"logo"},{default:t.withCtx(()=>[t.createElementVNode("img",{src:i.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,bn)]),_:1},8,["to"])):(t.openBlock(),t.createElementBlock("a",{key:0,href:i.logoImageAnchorPath,class:"logo"},[t.createElementVNode("img",{src:i.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,wn)],8,_n)),t.createVNode(ye,{"top-position":r.value},null,8,["top-position"])],512))}});const Pn=t.createElementVNode("p",{class:"quick-search-description"}," We maintain a catalog of public records about police, court, and jail systems across the United States. ",-1),En=t.defineComponent({__name:"QuickSearchForm",props:{mode:{default:"prod"}},setup(e){const n=U.useRouter(),r=e,a=[{id:"search-term",name:"searchTerm",label:"What are you looking for?",type:B.TEXT,placeholder:"Enter a keyword, type of public records, or 'all'",value:""},{id:"location",name:"location",label:"From where?",type:B.TEXT,placeholder:"Enter a state, county, municipality, or 'all'",value:""}];function o({location:s,searchTerm:i}){if(s=s.length>0?s:"all",i=i.length>0?i:"all",n.getRoutes().some(c=>c.path.includes("/search/")))n.push(`/search/${i}/${s}`);else{const c=r.mode==="prod"?"https://data-sources.pdap.io":"https://data-sources.pdap.dev";window.location.assign(`${c}/search/${i}/${s}`)}}return(s,i)=>(t.openBlock(),t.createBlock(W,{alignment:"center",component:"div",class:"pdap-quick-search-form"},{default:t.withCtx(()=>[Pn,t.createVNode(ve,{id:"quick-search-form",class:"small",schema:a,name:"quickSearchForm",onSubmit:o},{default:t.withCtx(()=>[t.createVNode(le,{type:"submit"},{default:t.withCtx(()=>[t.createTextVNode("Search Data Sources")]),_:1})]),_:1})]),_:1}))}});const Cn=["alt","src"],kn=t.defineComponent({__name:"TileIcon",props:{imgAltText:{},imgSrc:{}},setup(e){return(n,r)=>(t.openBlock(),t.createElementBlock("img",{class:"pdap-tile-icon",alt:n.imgAltText,src:n.imgSrc},null,8,Cn))}});exports.Button=le;exports.FlexContainer=W;exports.Footer=Le;exports.Form=ve;exports.GridContainer=fn;exports.GridItem=$n;exports.Header=xn;exports.Input=fe;exports.InputCheckbox=he;exports.InputText=$e;exports.Nav=ye;exports.PdapInputTypes=B;exports.QuickSearchForm=En;exports.TileIcon=kn;