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