pdap-design-system 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.cjs +3 -3
- package/dist/index.js +99 -101
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -1,3 +1,3 @@
|
|
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$:
|
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
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),X=require("vue-router"),le=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),Te={class:"pdap-footer-widget-links"},je=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 c=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),l=>(e.openBlock(),e.createElementBlock("li",{key:l.text,class:"pdap-footer-link-container"},[l.href?(e.openBlock(),e.createElementBlock("a",{key:0,class:"pdap-footer-social-link",href:l.href,target:"_blank",referrerpolicy:"no-referrer"},e.toDisplayString(l.text),9,Ve)):e.createCommentVNode("",!0),l.path?(e.openBlock(),e.createBlock(c,{key:1,"active-class":"pdap-footer-social-link-current","exact-active-class":"pdap-footer-social-link-current-exact",class:"pdap-footer-social-link",to:l.path},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(l.text),1)]),_:2},1032,["to"])):e.createCommentVNode("",!0)]))),128))]),Oe,Be,e.createElementVNode("div",Te,[je,e.unref(a)?(e.openBlock(),e.createBlock(c,{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 me(t){return t.$valid!==void 0?!t.$valid:!t}function De(t,r,n,a,o,s,c){let{$lazy:l,$rewardEarly:u}=o,m=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 p=e.watch([r,a].concat(m,g),()=>{if(l&&!a.value||u&&!f.value&&!n.value)return;let $;try{$=de(t,r,d,c)}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=me(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:p}}function Me(t,r,n,a,o,s,c,l){let{$lazy:u,$rewardEarly:m}=a;const d=()=>({}),f=e.computed(()=>{if(u&&!n.value||m&&!l.value)return!1;let g=!0;try{const h=de(t,r,c,s);o.value=h,g=me(h)}catch(h){o.value=h}return g});return{$unwatch:d,$invalid:f}}function qe(t,r,n,a,o,s,c,l,u,m,d){const f=e.ref(!1),g=t.$params||{},h=e.ref(null);let i,p;t.$async?{$invalid:i,$unwatch:p}=De(t.$validator,r,f,n,a,h,o,t.$watchTargets,u,m,d):{$invalid:i,$unwatch:p}=Me(t.$validator,r,n,a,h,o,u,m);const $=t.$message;return{$message:L($)?e.computed(()=>$(ee({$pending:f,$invalid:i,$params:ee(g),$model:r,$response:h,$validator:s,$propertyPath:l,$property:c}))):$||"",$params:g,$pending:f,$invalid:i,$response:h,$unwatch:p}}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 c=null;return n.forEach(l=>{const u=r[l];switch(!0){case L(u.$validator):a[l]=u;break;case L(u):a[l]={$validator:u};break;case l==="$validationGroups":c=u;break;case l.startsWith("$"):s[l]=u;break;default:o[l]=u}}),{rules:a,nestedValidators:o,config:s,validationGroups:c}}const He="__root";function Ge(t,r,n,a,o,s,c,l,u){const m=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 m.length?(m.forEach(p=>{i[p]=qe(t[p],r,i.$dirty,s,c,p,n,o,u,g,h)}),i.$externalResults=e.computed(()=>l.value?[].concat(l.value).map((p,$)=>({$propertyPath:o,$property:n,$validator:"$externalResults",$uid:`${o}-externalResult-${$}`,$message:p,$params:{},$response:null,$pending:!1})):[]),i.$invalid=e.computed(()=>{const p=m.some($=>e.unref(i[$].$invalid));return g.value=p,!!i.$externalResults.value.length||p}),i.$pending=e.computed(()=>m.some(p=>e.unref(i[p].$pending))),i.$error=e.computed(()=>i.$dirty.value?i.$pending.value||i.$invalid.value:!1),i.$silentErrors=e.computed(()=>m.filter(p=>e.unref(i[p].$invalid)).map(p=>{const $=i[p];return e.reactive({$propertyPath:o,$property:n,$validator:p,$uid:`${o}-${p}`,$message:$.$message,$params:$.$params,$response:$.$response,$pending:$.$pending})}).concat(i.$externalResults.value)),i.$errors=e.computed(()=>i.$dirty.value?i.$silentErrors.value:[]),i.$unwatch=()=>m.forEach(p=>{i[p].$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,c){const l=Object.keys(t);return l.length?l.reduce((u,m)=>(u[m]=G({validations:t[m],state:r,key:m,parentKey:n,resultsCache:a,globalConfig:o,instance:s,externalResults:c}),u),{}):{}}function Ue(t,r,n){const a=e.computed(()=>[r,n].filter(i=>i).reduce((i,p)=>i.concat(Object.values(e.unref(p))),[])),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)||[],p=a.value.filter($=>(e.unref($).$silentErrors||[]).length).reduce(($,v)=>$.concat(...v.$silentErrors),[]);return i.concat(p)}),c=e.computed(()=>{const i=e.unref(t.$errors)||[],p=a.value.filter($=>(e.unref($).$errors||[]).length).reduce(($,v)=>$.concat(...v.$errors),[]);return i.concat(p)}),l=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),m=e.computed(()=>a.value.some(i=>i.$dirty)||a.value.some(i=>i.$anyDirty)||o.value),d=e.computed(()=>o.value?u.value||l.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:c,$invalid:l,$anyDirty:m,$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:c,globalConfig:l={},instance:u,externalResults:m}=t;const d=o?`${o}.${a}`:a,{rules:f,nestedValidators:g,config:h,validationGroups:i}=Fe(r),p=P(P({},l),h),$=a?e.computed(()=>{const y=e.unref(n);return y?e.unref(y[a]):void 0}):n,v=P({},e.unref(m)||{}),B=e.computed(()=>{const y=e.unref(m);return a?y?e.unref(y[a]):void 0:y}),D=Ge(f,$,a,c,d,p,u,B,n),w=Xe(g,$,d,c,p,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(m);E&&(E[a]=v[a]),e.isRef(V[a])?V[a].value=y:V[a]=y}}):null;a&&p.$autoDirty&&e.watch($,()=>{x.value||F();const y=e.unref(m);y&&(y[a]=v[a])},{flush:"sync"});async function Ee(){return F(),p.$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(m)?m.value=v:Object.keys(v).length===0?Object.keys(m).forEach(y=>{delete m[y]}):Object.assign(m,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(l=>o.includes(l))?!1:s.every(l=>n[l].$params?Object.keys(n[l].$params).every(u=>e.unref(a[l].$params[u])===e.unref(n[l].$params[u])):!0)}get(r,n){const a=this.storage.get(r);if(!a)return;const{rules:o,result:s}=a,c=this.checkRulesValidity(r,n,o),l=s.$unwatch?s.$unwatch:()=>({});return c?s:{$dirty:s.$dirty,$partial:!0,$unwatch:l}}}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 c(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||[],c);function l(d){o.value=o.value.filter(f=>f!==d),delete a[d]}n.__vuelidateRemoveInstances=[].concat(n.__vuelidateRemoveInstances||[],l);const u=e.inject(re,[]);e.provide(re,n.__vuelidateInjectInstances);const m=e.inject(ne,[]);return e.provide(ne,n.__vuelidateRemoveInstances),{childResults:s,sendValidationResultsToParent:u,removeValidationResultsFromParent:m}}function pe(t){return new Proxy(t,{get(r,n){return typeof r[n]=="object"?pe(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:c,$externalResults:l,currentVueInstance:u}=a;const m=u||((n=e.getCurrentInstance())===null||n===void 0?void 0:n.proxy),d=m?m.$options:{};o||(ae+=1,o=`_vuelidate_${ae}`);const f=e.ref({}),g=new We,{childResults:h,sendValidationResultsToParent:i,removeValidationResultsFromParent:p}=m?Ke({$scope:s,instance:m}):{childResults:e.ref({})};if(!t&&d.validations){const $=d.validations;r=e.ref({}),e.onBeforeMount(()=>{r.value=m,e.watch(()=>L($)?$.call(r.value,new pe(r.value)):$,v=>{f.value=G({validations:v,state:r,childResults:h,resultsCache:g,globalConfig:a,instance:m,externalResults:l||m.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:m??{},externalResults:l})},{immediate:!0})}return m&&(i.forEach($=>$(f,{$registerAs:o,$scope:s,$stopPropagation:c})),e.onBeforeUnmount(()=>p.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=()=>{c.value=!c.value,a("change",c.value.toString())},s=u=>{a("input",u.target.value)},c=e.ref(n.defaultChecked),l=e.computed(()=>`pdap-${n.name}-input-error`);return(u,m)=>{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:c.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:l.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 T(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 j(t){return typeof t=="function"}function I(t){return t!==null&&typeof t=="object"&&!Array.isArray(t)}function z(t){return j(t.$validator)?T({},t):{$validator:t}}function rt(t){return I(t)&&j(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)&&!j(r))throw new Error("[@vuelidate/validators]: Validator must be a function or object with $validator parameter");const n=z(r);return n.$params=T(T({},n.$params||{}),t),n}function A(t,r){if(!j(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)&&!j(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 T(T({},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,c,l)=>{const u=Object.entries(c).reduce((m,d)=>{let[f,g]=d;const h=t[f]||{},i=Object.entries(h).reduce((p,$)=>{let[v,B]=$;const w=O(B).call(this,g,c,l,...a),R=C(w);if(p.$data[v]=w,p.$data.$invalid=!R||!!p.$data.$invalid,p.$data.$error=p.$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})),p.$errors.push({$property:f,$message:x,$params:S,$response:w,$model:g,$pending:!1,$validator:v})}return{$valid:p.$valid&&R,$data:p.$data,$errors:p.$errors}},{$valid:!0,$data:{},$errors:[]});return m.$data[f]=i.$data,m.$errors[f]=i.$errors,{$valid:m.$valid&&i.$valid,$data:m.$data,$errors:m.$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]*$/),ct={$validator:it,$message:"The value must be alpha-numeric",$params:{type:"alphaNum"}},lt=k(/^\d*(\.\d+)?$/),ut={$validator:lt,$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 mt(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 pt=/^(?:[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(pt),$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 Tt(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 jt=/^(?:(?:(?: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(jt),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 c=await o;return C(c)?c: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(c=>c.$async),o=r.reduce((c,l)=>l.$watchTargets?c.concat(l.$watchTargets):c,[]);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 c=await o;return C(c)?O(s).apply(this,n):c},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(c=>c.$async),o=r.reduce((c,l)=>l.$watchTargets?c.concat(l.$watchTargets):c,[]);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:c=!1,messagePath:l=n,messageParams:u=a}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};function m(d){return r(l(d),u(T({model:d.$model,property:d.$property,pending:d.$pending,invalid:d.$invalid,response:d.$response,validator:d.$validator,propertyPath:d.$propertyPath},d.$params)))}return c&&typeof s=="function"?function(){return A(m,s(...arguments))}:A(m,s)}}const $e=Object.freeze(Object.defineProperty({__proto__:null,alpha:st,alphaNum:ct,and:Ft,between:mt,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:Tt,url:St},Symbol.toStringTag,{value:"Module"}));function ce(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(ce(t)&&typeof r.message=="string"&&typeof r.value=="number")return rr(t,r.value,r.message);if(ce(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,p])=>({...h,...or(i,p)}),{});return{...d,[f.name]:{...g}}},{}),c=Qe(s,o,{$autoDirty:!1,$lazy:!0}),l=e.ref(n.error);function u(d,f){o.value[d]=f}e.watchEffect(()=>{n.error?l.value=n.error:l.value&&c.value.$errors.length===0?l.value=null:!l.value&&c.value.$errors.length>0&&(l.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$:c}})});async function m(d){if(await c.value.$validate()){a("submit",{...o.value}),c.value.$reset(),d.target.reset(),o.value=Object.entries(o.value).reduce((h,[i,p])=>({...h,[i]:["true","false"].includes(p)?p:""}),{});return}}return(d,f)=>(e.openBlock(),e.createElementBlock("form",{class:"pdap-form",onSubmit:f[0]||(f[0]=e.withModifiers(g=>m(g),["prevent"]))},[typeof l.value=="string"&&l.value.length>0?(e.openBlock(),e.createElementBlock("div",sr,e.toDisplayString(l.value),1)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.schema,g=>{var h,i,p,$;return e.openBlock(),e.createBlock(fe,e.mergeProps((delete g.validators,g),{key:g.name,error:(h=e.unref(c)[g.name])!=null&&h.$error?($=(p=(i=e.unref(c)[g.name])==null?void 0:i.$errors)==null?void 0:p[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(c,l)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(c.component),{class:e.normalizeClass(n),style:e.normalizeStyle(s)},{default:e.withCtx(()=>[e.renderSlot(c.$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 cr=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),lr=[cr],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 l,u;const c=document.querySelector("body");!n.isExpanded&&n.isMobile?(n.isExpanded=!0,c!=null&&c.classList.contains("lock-scroll")||(l=document.querySelector("body"))==null||l.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(c,l)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",{"aria-controls":"nav",class:"pdap-nav-open-button",role:"button",onClick:s},lr),e.createElementVNode("nav",{id:"nav","aria-expanded":n.isMobile&&n.isExpanded||!n.isMobile,class:e.normalizeClass(a),style:e.normalizeStyle(n.isMobile?{top:`${c.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 mr=["href"],pr=["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(c,l)=>(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:c.logoImageAnchorPath,class:"logo"},{default:e.withCtx(()=>[e.createElementVNode("img",{src:c.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:c.logoImageAnchorPath,class:"logo"},[e.createElementVNode("img",{src:c.logoImageSrc,loading:"lazy",width:"250",alt:"Police Data Accessibility Project Logo"},null,8,pr)],8,mr)),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(s){let{location:c,searchTerm:l}=s;if(c=c&&c.length>0?c:"all",l=l&&l.length>0?l:"all",r.getRoutes().some(u=>u.path.includes("/search/")))r.push(`/search/${l}/${c}`);else{const u=n.mode==="prod"?"https://data-sources.pdap.io":"https://data-sources.pdap.dev";window.location.assign(`${u}/search/${l}/${c}`)}}return(s,c)=>(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(le,{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=le;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;
|
package/dist/index.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent as j, reactive as C, openBlock as v, createElementBlock as b, normalizeClass as G, renderSlot as K, createBlock as A, resolveDynamicComponent as
|
1
|
+
import { defineComponent as j, reactive as C, openBlock as v, createElementBlock as b, normalizeClass as G, renderSlot as K, createBlock as A, resolveDynamicComponent as me, withCtx as E, inject as J, resolveComponent as Qe, createVNode as Y, createElementVNode as P, Fragment as ee, renderList as fe, unref as c, toDisplayString as D, createCommentVNode as q, createTextVNode as B, getCurrentInstance as Ze, ref as x, onBeforeMount as Ve, watch as X, isRef as ce, onBeforeUnmount as $e, computed as _, isReactive as Je, isReadonly as Ye, provide as be, nextTick as te, mergeProps as de, watchEffect as Pe, withModifiers as et, normalizeStyle as ge, onMounted as tt } from "vue";
|
2
2
|
import { RouterLink as Se, useRouter as rt } from "vue-router";
|
3
3
|
const nt = /* @__PURE__ */ j({
|
4
4
|
__name: "PdapButton",
|
@@ -30,7 +30,7 @@ const ke = /* @__PURE__ */ j({
|
|
30
30
|
"pdap-flex-container": !0,
|
31
31
|
[`pdap-flex-container-${e.alignment}`]: !0
|
32
32
|
});
|
33
|
-
return (n, a) => (v(), A(
|
33
|
+
return (n, a) => (v(), A(me(n.component), {
|
34
34
|
class: G(r)
|
35
35
|
}, {
|
36
36
|
default: E(() => [
|
@@ -56,7 +56,7 @@ const at = { class: "pdap-footer" }, st = { class: "pdap-footer-social-links" },
|
|
56
56
|
target: "_blank"
|
57
57
|
}, [
|
58
58
|
/* @__PURE__ */ P("img", { src: "https://widgets.guidestar.org/gximage2?o=9973356&l=v4" })
|
59
|
-
], -1), dt = ["href"], pt = ["src"],
|
59
|
+
], -1), dt = ["href"], pt = ["src"], mt = ["src"], Zr = /* @__PURE__ */ j({
|
60
60
|
__name: "PdapFooter",
|
61
61
|
props: {
|
62
62
|
logoImageSrc: { default: "node_modules/pdap-design-system/dist/images/acronym.svg" },
|
@@ -87,7 +87,7 @@ const at = { class: "pdap-footer" }, st = { class: "pdap-footer-social-links" },
|
|
87
87
|
Y(ke, { alignment: "center" }, {
|
88
88
|
default: E(() => [
|
89
89
|
P("ul", st, [
|
90
|
-
(v(!0), b(ee, null,
|
90
|
+
(v(!0), b(ee, null, fe(c(r), (u) => (v(), b("li", {
|
91
91
|
key: u.text,
|
92
92
|
class: "pdap-footer-link-container"
|
93
93
|
}, [
|
@@ -127,7 +127,7 @@ const at = { class: "pdap-footer" }, st = { class: "pdap-footer-social-links" },
|
|
127
127
|
loading: "lazy",
|
128
128
|
width: "250",
|
129
129
|
alt: "Police Data Accessibility Project Logo"
|
130
|
-
}, null, 8,
|
130
|
+
}, null, 8, mt)
|
131
131
|
]),
|
132
132
|
_: 1
|
133
133
|
}, 8, ["to"])) : (v(), b("a", {
|
@@ -164,14 +164,14 @@ function V(e) {
|
|
164
164
|
for (var t = 1; t < arguments.length; t++) {
|
165
165
|
var r = arguments[t] != null ? arguments[t] : {};
|
166
166
|
t % 2 ? xe(Object(r), !0).forEach(function(n) {
|
167
|
-
|
167
|
+
ft(e, n, r[n]);
|
168
168
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : xe(Object(r)).forEach(function(n) {
|
169
169
|
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
170
170
|
});
|
171
171
|
}
|
172
172
|
return e;
|
173
173
|
}
|
174
|
-
function
|
174
|
+
function ft(e, t, r) {
|
175
175
|
return t in e ? Object.defineProperty(e, t, {
|
176
176
|
value: r,
|
177
177
|
enumerable: !0,
|
@@ -222,11 +222,11 @@ function gt(e, t, r, n, a, s, i) {
|
|
222
222
|
let {
|
223
223
|
$lazy: u,
|
224
224
|
$rewardEarly: l
|
225
|
-
} = a, p = arguments.length > 7 && arguments[7] !== void 0 ? arguments[7] : [], d = arguments.length > 8 ? arguments[8] : void 0,
|
225
|
+
} = a, 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;
|
226
226
|
const h = x(!!n.value), o = x(0);
|
227
227
|
r.value = !1;
|
228
|
-
const
|
229
|
-
if (u && !n.value || l && !
|
228
|
+
const m = X([t, n].concat(p, g), () => {
|
229
|
+
if (u && !n.value || l && !f.value && !r.value)
|
230
230
|
return;
|
231
231
|
let $;
|
232
232
|
try {
|
@@ -245,7 +245,7 @@ function gt(e, t, r, n, a, s, i) {
|
|
245
245
|
});
|
246
246
|
return {
|
247
247
|
$invalid: h,
|
248
|
-
$unwatch:
|
248
|
+
$unwatch: m
|
249
249
|
};
|
250
250
|
}
|
251
251
|
function ht(e, t, r, n, a, s, i, u) {
|
@@ -253,7 +253,7 @@ function ht(e, t, r, n, a, s, i, u) {
|
|
253
253
|
$lazy: l,
|
254
254
|
$rewardEarly: p
|
255
255
|
} = n;
|
256
|
-
const d = () => ({}),
|
256
|
+
const d = () => ({}), f = _(() => {
|
257
257
|
if (l && !r.value || p && !u.value)
|
258
258
|
return !1;
|
259
259
|
let g = !0;
|
@@ -267,23 +267,23 @@ function ht(e, t, r, n, a, s, i, u) {
|
|
267
267
|
});
|
268
268
|
return {
|
269
269
|
$unwatch: d,
|
270
|
-
$invalid:
|
270
|
+
$invalid: f
|
271
271
|
};
|
272
272
|
}
|
273
273
|
function vt(e, t, r, n, a, s, i, u, l, p, d) {
|
274
|
-
const
|
275
|
-
let o,
|
274
|
+
const f = x(!1), g = e.$params || {}, h = x(null);
|
275
|
+
let o, m;
|
276
276
|
e.$async ? {
|
277
277
|
$invalid: o,
|
278
|
-
$unwatch:
|
279
|
-
} = gt(e.$validator, t,
|
278
|
+
$unwatch: m
|
279
|
+
} = gt(e.$validator, t, f, r, n, h, a, e.$watchTargets, l, p, d) : {
|
280
280
|
$invalid: o,
|
281
|
-
$unwatch:
|
281
|
+
$unwatch: m
|
282
282
|
} = ht(e.$validator, t, r, n, h, a, l, p);
|
283
283
|
const $ = e.$message;
|
284
284
|
return {
|
285
285
|
$message: re($) ? _(() => $(Re({
|
286
|
-
$pending:
|
286
|
+
$pending: f,
|
287
287
|
$invalid: o,
|
288
288
|
$params: Re(g),
|
289
289
|
$model: t,
|
@@ -293,10 +293,10 @@ function vt(e, t, r, n, a, s, i, u, l, p, d) {
|
|
293
293
|
$property: i
|
294
294
|
}))) : $ || "",
|
295
295
|
$params: g,
|
296
|
-
$pending:
|
296
|
+
$pending: f,
|
297
297
|
$invalid: o,
|
298
298
|
$response: h,
|
299
|
-
$unwatch:
|
299
|
+
$unwatch: m
|
300
300
|
};
|
301
301
|
}
|
302
302
|
function yt() {
|
@@ -332,52 +332,52 @@ function yt() {
|
|
332
332
|
}
|
333
333
|
const _t = "__root";
|
334
334
|
function wt(e, t, r, n, a, s, i, u, l) {
|
335
|
-
const p = Object.keys(e), d = n.get(a, e),
|
335
|
+
const p = Object.keys(e), d = n.get(a, e), f = x(!1), g = x(!1), h = x(0);
|
336
336
|
if (d) {
|
337
337
|
if (!d.$partial)
|
338
338
|
return d;
|
339
|
-
d.$unwatch(),
|
339
|
+
d.$unwatch(), f.value = d.$dirty.value;
|
340
340
|
}
|
341
341
|
const o = {
|
342
|
-
$dirty:
|
342
|
+
$dirty: f,
|
343
343
|
$path: a,
|
344
344
|
$touch: () => {
|
345
|
-
|
345
|
+
f.value || (f.value = !0);
|
346
346
|
},
|
347
347
|
$reset: () => {
|
348
|
-
|
348
|
+
f.value && (f.value = !1);
|
349
349
|
},
|
350
350
|
$commit: () => {
|
351
351
|
}
|
352
352
|
};
|
353
|
-
return p.length ? (p.forEach((
|
354
|
-
o[
|
355
|
-
}), o.$externalResults = _(() => u.value ? [].concat(u.value).map((
|
353
|
+
return p.length ? (p.forEach((m) => {
|
354
|
+
o[m] = vt(e[m], t, o.$dirty, s, i, m, r, a, l, g, h);
|
355
|
+
}), o.$externalResults = _(() => u.value ? [].concat(u.value).map((m, $) => ({
|
356
356
|
$propertyPath: a,
|
357
357
|
$property: r,
|
358
358
|
$validator: "$externalResults",
|
359
359
|
$uid: `${a}-externalResult-${$}`,
|
360
|
-
$message:
|
360
|
+
$message: m,
|
361
361
|
$params: {},
|
362
362
|
$response: null,
|
363
363
|
$pending: !1
|
364
364
|
})) : []), o.$invalid = _(() => {
|
365
|
-
const
|
366
|
-
return g.value =
|
367
|
-
}), o.$pending = _(() => p.some((
|
368
|
-
const $ = o[
|
365
|
+
const m = p.some(($) => c(o[$].$invalid));
|
366
|
+
return g.value = m, !!o.$externalResults.value.length || m;
|
367
|
+
}), o.$pending = _(() => p.some((m) => c(o[m].$pending))), o.$error = _(() => o.$dirty.value ? o.$pending.value || o.$invalid.value : !1), o.$silentErrors = _(() => p.filter((m) => c(o[m].$invalid)).map((m) => {
|
368
|
+
const $ = o[m];
|
369
369
|
return C({
|
370
370
|
$propertyPath: a,
|
371
371
|
$property: r,
|
372
|
-
$validator:
|
373
|
-
$uid: `${a}-${
|
372
|
+
$validator: m,
|
373
|
+
$uid: `${a}-${m}`,
|
374
374
|
$message: $.$message,
|
375
375
|
$params: $.$params,
|
376
376
|
$response: $.$response,
|
377
377
|
$pending: $.$pending
|
378
378
|
});
|
379
|
-
}).concat(o.$externalResults.value)), o.$errors = _(() => o.$dirty.value ? o.$silentErrors.value : []), o.$unwatch = () => p.forEach((
|
380
|
-
o[
|
379
|
+
}).concat(o.$externalResults.value)), o.$errors = _(() => o.$dirty.value ? o.$silentErrors.value : []), o.$unwatch = () => p.forEach((m) => {
|
380
|
+
o[m].$unwatch();
|
381
381
|
}), o.$commit = () => {
|
382
382
|
g.value = !0, h.value = Date.now();
|
383
383
|
}, n.set(a, e, o), o) : (d && n.set(a, e, o), o);
|
@@ -396,7 +396,7 @@ function bt(e, t, r, n, a, s, i) {
|
|
396
396
|
}), l), {}) : {};
|
397
397
|
}
|
398
398
|
function Pt(e, t, r) {
|
399
|
-
const n = _(() => [t, r].filter((o) => o).reduce((o,
|
399
|
+
const n = _(() => [t, r].filter((o) => o).reduce((o, m) => o.concat(Object.values(c(m))), [])), a = _({
|
400
400
|
get() {
|
401
401
|
return e.$dirty.value || (n.value.length ? n.value.every((o) => o.$dirty) : !1);
|
402
402
|
},
|
@@ -404,12 +404,12 @@ function Pt(e, t, r) {
|
|
404
404
|
e.$dirty.value = o;
|
405
405
|
}
|
406
406
|
}), s = _(() => {
|
407
|
-
const o = c(e.$silentErrors) || [],
|
408
|
-
return o.concat(
|
407
|
+
const o = c(e.$silentErrors) || [], m = n.value.filter(($) => (c($).$silentErrors || []).length).reduce(($, y) => $.concat(...y.$silentErrors), []);
|
408
|
+
return o.concat(m);
|
409
409
|
}), i = _(() => {
|
410
|
-
const o = c(e.$errors) || [],
|
411
|
-
return o.concat(
|
412
|
-
}), u = _(() => n.value.some((o) => o.$invalid) || c(e.$invalid) || !1), l = _(() => n.value.some((o) => c(o.$pending)) || c(e.$pending) || !1), p = _(() => n.value.some((o) => o.$dirty) || n.value.some((o) => o.$anyDirty) || a.value), d = _(() => a.value ? l.value || u.value : !1),
|
410
|
+
const o = c(e.$errors) || [], m = n.value.filter(($) => (c($).$errors || []).length).reduce(($, y) => $.concat(...y.$errors), []);
|
411
|
+
return o.concat(m);
|
412
|
+
}), u = _(() => n.value.some((o) => o.$invalid) || c(e.$invalid) || !1), l = _(() => n.value.some((o) => c(o.$pending)) || c(e.$pending) || !1), p = _(() => n.value.some((o) => o.$dirty) || n.value.some((o) => o.$anyDirty) || a.value), d = _(() => a.value ? l.value || u.value : !1), f = () => {
|
413
413
|
e.$touch(), n.value.forEach((o) => {
|
414
414
|
o.$touch();
|
415
415
|
});
|
@@ -422,14 +422,14 @@ function Pt(e, t, r) {
|
|
422
422
|
o.$reset();
|
423
423
|
});
|
424
424
|
};
|
425
|
-
return n.value.length && n.value.every((o) => o.$dirty) &&
|
425
|
+
return n.value.length && n.value.every((o) => o.$dirty) && f(), {
|
426
426
|
$dirty: a,
|
427
427
|
$errors: i,
|
428
428
|
$invalid: u,
|
429
429
|
$anyDirty: p,
|
430
430
|
$error: d,
|
431
431
|
$pending: l,
|
432
|
-
$touch:
|
432
|
+
$touch: f,
|
433
433
|
$reset: h,
|
434
434
|
$silentErrors: s,
|
435
435
|
$commit: g
|
@@ -448,17 +448,17 @@ function pe(e) {
|
|
448
448
|
externalResults: p
|
449
449
|
} = e;
|
450
450
|
const d = a ? `${a}.${n}` : n, {
|
451
|
-
rules:
|
451
|
+
rules: f,
|
452
452
|
nestedValidators: g,
|
453
453
|
config: h,
|
454
454
|
validationGroups: o
|
455
|
-
} = yt(t),
|
455
|
+
} = yt(t), m = V(V({}, u), h), $ = n ? _(() => {
|
456
456
|
const w = c(r);
|
457
457
|
return w ? c(w[n]) : void 0;
|
458
458
|
}) : r, y = V({}, c(p) || {}), F = _(() => {
|
459
459
|
const w = c(p);
|
460
460
|
return n ? w ? c(w[n]) : void 0 : w;
|
461
|
-
}), se = wt(
|
461
|
+
}), se = wt(f, $, n, i, d, m, l, F, r), O = bt(g, $, d, i, m, l, F), z = {};
|
462
462
|
o && Object.entries(o).forEach((w) => {
|
463
463
|
let [M, L] = w;
|
464
464
|
z[M] = {
|
@@ -488,7 +488,7 @@ function pe(e) {
|
|
488
488
|
L && (L[n] = y[n]), ce(M[n]) ? M[n].value = w : M[n] = w;
|
489
489
|
}
|
490
490
|
}) : null;
|
491
|
-
n &&
|
491
|
+
n && m.$autoDirty && X($, () => {
|
492
492
|
I.value || ue();
|
493
493
|
const w = c(p);
|
494
494
|
w && (w[n] = y[n]);
|
@@ -496,7 +496,7 @@ function pe(e) {
|
|
496
496
|
flush: "sync"
|
497
497
|
});
|
498
498
|
async function We() {
|
499
|
-
return ue(),
|
499
|
+
return ue(), m.$rewardEarly && (we(), await te()), await te(), new Promise((w) => {
|
500
500
|
if (!ie.value)
|
501
501
|
return w(!oe.value);
|
502
502
|
const M = X(ie, () => {
|
@@ -570,18 +570,18 @@ function Rt(e) {
|
|
570
570
|
$scope: t,
|
571
571
|
instance: r
|
572
572
|
} = e;
|
573
|
-
const n = {}, a = x([]), s = _(() => a.value.reduce((d,
|
574
|
-
function i(d,
|
573
|
+
const n = {}, a = x([]), s = _(() => a.value.reduce((d, f) => (d[f] = c(n[f]), d), {}));
|
574
|
+
function i(d, f) {
|
575
575
|
let {
|
576
576
|
$registerAs: g,
|
577
577
|
$scope: h,
|
578
578
|
$stopPropagation: o
|
579
|
-
} =
|
579
|
+
} = f;
|
580
580
|
o || t === Z.COLLECT_NONE || h === Z.COLLECT_NONE || t !== Z.COLLECT_ALL && t !== h || (n[g] = d, a.value.push(g));
|
581
581
|
}
|
582
582
|
r.__vuelidateInjectInstances = [].concat(r.__vuelidateInjectInstances || [], i);
|
583
583
|
function u(d) {
|
584
|
-
a.value = a.value.filter((
|
584
|
+
a.value = a.value.filter((f) => f !== d), delete n[d];
|
585
585
|
}
|
586
586
|
r.__vuelidateRemoveInstances = [].concat(r.__vuelidateRemoveInstances || [], u);
|
587
587
|
const l = J(Ee, []);
|
@@ -614,10 +614,10 @@ function Ot(e, t) {
|
|
614
614
|
} = n;
|
615
615
|
const p = l || ((r = Ze()) === null || r === void 0 ? void 0 : r.proxy), d = p ? p.$options : {};
|
616
616
|
a || (je += 1, a = `_vuelidate_${je}`);
|
617
|
-
const
|
617
|
+
const f = x({}), g = new xt(), {
|
618
618
|
childResults: h,
|
619
619
|
sendValidationResultsToParent: o,
|
620
|
-
removeValidationResultsFromParent:
|
620
|
+
removeValidationResultsFromParent: m
|
621
621
|
} = p ? Rt({
|
622
622
|
$scope: s,
|
623
623
|
instance: p
|
@@ -628,7 +628,7 @@ function Ot(e, t) {
|
|
628
628
|
const $ = d.validations;
|
629
629
|
t = x({}), Ve(() => {
|
630
630
|
t.value = p, X(() => re($) ? $.call(t.value, new qe(t.value)) : $, (y) => {
|
631
|
-
|
631
|
+
f.value = pe({
|
632
632
|
validations: y,
|
633
633
|
state: t,
|
634
634
|
childResults: h,
|
@@ -644,7 +644,7 @@ function Ot(e, t) {
|
|
644
644
|
} else {
|
645
645
|
const $ = ce(e) || $t(e) ? e : C(e || {});
|
646
646
|
X($, (y) => {
|
647
|
-
|
647
|
+
f.value = pe({
|
648
648
|
validations: y,
|
649
649
|
state: t,
|
650
650
|
childResults: h,
|
@@ -657,11 +657,11 @@ function Ot(e, t) {
|
|
657
657
|
immediate: !0
|
658
658
|
});
|
659
659
|
}
|
660
|
-
return p && (o.forEach(($) => $(
|
660
|
+
return p && (o.forEach(($) => $(f, {
|
661
661
|
$registerAs: a,
|
662
662
|
$scope: s,
|
663
663
|
$stopPropagation: i
|
664
|
-
})), $e(() =>
|
664
|
+
})), $e(() => m.forEach(($) => $(a)))), _(() => V(V({}, c(f.value)), h.value));
|
665
665
|
}
|
666
666
|
var T = /* @__PURE__ */ ((e) => (e.CHECKBOX = "checkbox", e.TEXT = "text", e))(T || {});
|
667
667
|
const Et = ["id", "name", "placeholder", "value"], Ct = ["id", "name", "checked", "value"], jt = ["id"], At = ["for"], Tt = /* @__PURE__ */ j({
|
@@ -803,11 +803,11 @@ function St(e) {
|
|
803
803
|
n[a - 1] = arguments[a];
|
804
804
|
return c(t).reduce((s, i, u) => {
|
805
805
|
const l = Object.entries(i).reduce((p, d) => {
|
806
|
-
let [
|
807
|
-
const h = e[
|
806
|
+
let [f, g] = d;
|
807
|
+
const h = e[f] || {}, o = Object.entries(h).reduce((m, $) => {
|
808
808
|
let [y, F] = $;
|
809
809
|
const O = N(F).call(this, g, i, u, ...n), z = S(O);
|
810
|
-
if (
|
810
|
+
if (m.$data[y] = O, m.$data.$invalid = !z || !!m.$data.$invalid, m.$data.$error = m.$data.$invalid, !z) {
|
811
811
|
let I = F.$message || "";
|
812
812
|
const Q = F.$params || {};
|
813
813
|
typeof I == "function" && (I = I({
|
@@ -816,8 +816,8 @@ function St(e) {
|
|
816
816
|
$params: Q,
|
817
817
|
$model: g,
|
818
818
|
$response: O
|
819
|
-
})),
|
820
|
-
$property:
|
819
|
+
})), m.$errors.push({
|
820
|
+
$property: f,
|
821
821
|
$message: I,
|
822
822
|
$params: Q,
|
823
823
|
$response: O,
|
@@ -827,16 +827,16 @@ function St(e) {
|
|
827
827
|
});
|
828
828
|
}
|
829
829
|
return {
|
830
|
-
$valid:
|
831
|
-
$data:
|
832
|
-
$errors:
|
830
|
+
$valid: m.$valid && z,
|
831
|
+
$data: m.$data,
|
832
|
+
$errors: m.$errors
|
833
833
|
};
|
834
834
|
}, {
|
835
835
|
$valid: !0,
|
836
836
|
$data: {},
|
837
837
|
$errors: []
|
838
838
|
});
|
839
|
-
return p.$data[
|
839
|
+
return p.$data[f] = o.$data, p.$errors[f] = o.$errors, {
|
840
840
|
$valid: p.$valid && o.$valid,
|
841
841
|
$data: p.$data,
|
842
842
|
$errors: p.$errors
|
@@ -1094,14 +1094,14 @@ var dr = k(cr), pr = {
|
|
1094
1094
|
type: "url"
|
1095
1095
|
}
|
1096
1096
|
};
|
1097
|
-
function
|
1097
|
+
function mr(e) {
|
1098
1098
|
return function() {
|
1099
1099
|
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
1100
1100
|
r[n] = arguments[n];
|
1101
1101
|
return e.reduce((a, s) => S(a) ? a : N(s).apply(this, r), !1);
|
1102
1102
|
};
|
1103
1103
|
}
|
1104
|
-
function
|
1104
|
+
function fr(e) {
|
1105
1105
|
return function() {
|
1106
1106
|
for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++)
|
1107
1107
|
r[n] = arguments[n];
|
@@ -1116,7 +1116,7 @@ function $r() {
|
|
1116
1116
|
t[r] = arguments[r];
|
1117
1117
|
const n = t.some((i) => i.$async), a = t.reduce((i, u) => u.$watchTargets ? i.concat(u.$watchTargets) : i, []);
|
1118
1118
|
let s = () => !1;
|
1119
|
-
return t.length && (s = n ?
|
1119
|
+
return t.length && (s = n ? fr(t) : mr(t)), {
|
1120
1120
|
$async: n,
|
1121
1121
|
$validator: s,
|
1122
1122
|
$watchTargets: a
|
@@ -1332,32 +1332,32 @@ const zr = {
|
|
1332
1332
|
emits: ["submit"],
|
1333
1333
|
setup(e, { emit: t }) {
|
1334
1334
|
const r = e, n = t, a = x(
|
1335
|
-
r.schema.reduce((d,
|
1336
|
-
switch (
|
1335
|
+
r.schema.reduce((d, f) => {
|
1336
|
+
switch (f.type) {
|
1337
1337
|
case T.CHECKBOX:
|
1338
|
-
return { ...d, [
|
1338
|
+
return { ...d, [f.name]: String(f.defaultChecked) };
|
1339
1339
|
case T.TEXT:
|
1340
1340
|
default:
|
1341
|
-
return { ...d, [
|
1341
|
+
return { ...d, [f.name]: f.value };
|
1342
1342
|
}
|
1343
1343
|
}, {})
|
1344
|
-
), s = r.schema.reduce((d,
|
1345
|
-
const g = Object.entries(
|
1346
|
-
(h, [o,
|
1344
|
+
), s = r.schema.reduce((d, f) => {
|
1345
|
+
const g = Object.entries(f.validators ?? {}).reduce(
|
1346
|
+
(h, [o, m]) => ({
|
1347
1347
|
...h,
|
1348
|
-
...kr(o,
|
1348
|
+
...kr(o, m)
|
1349
1349
|
}),
|
1350
1350
|
{}
|
1351
1351
|
);
|
1352
1352
|
return {
|
1353
1353
|
...d,
|
1354
|
-
[
|
1354
|
+
[f.name]: {
|
1355
1355
|
...g
|
1356
1356
|
}
|
1357
1357
|
};
|
1358
1358
|
}, {}), i = Ot(s, a, { $autoDirty: !1, $lazy: !0 }), u = x(r.error);
|
1359
|
-
function l(d,
|
1360
|
-
a.value[d] =
|
1359
|
+
function l(d, f) {
|
1360
|
+
a.value[d] = f;
|
1361
1361
|
}
|
1362
1362
|
Pe(() => {
|
1363
1363
|
r.error ? u.value = r.error : u.value && i.value.$errors.length === 0 ? u.value = null : !u.value && i.value.$errors.length > 0 && (u.value = "Please update this form to correct the errors");
|
@@ -1374,20 +1374,20 @@ const zr = {
|
|
1374
1374
|
});
|
1375
1375
|
async function p(d) {
|
1376
1376
|
if (await i.value.$validate()) {
|
1377
|
-
n("submit", { ...a }), i.value.$reset(), d.target.reset(), a.value = Object.entries(a.value).reduce((h, [o,
|
1377
|
+
n("submit", { ...a.value }), i.value.$reset(), d.target.reset(), a.value = Object.entries(a.value).reduce((h, [o, m]) => ({ ...h, [o]: ["true", "false"].includes(m) ? m : "" }), {});
|
1378
1378
|
return;
|
1379
1379
|
}
|
1380
1380
|
}
|
1381
|
-
return (d,
|
1381
|
+
return (d, f) => (v(), b("form", {
|
1382
1382
|
class: "pdap-form",
|
1383
|
-
onSubmit:
|
1383
|
+
onSubmit: f[0] || (f[0] = et((g) => p(g), ["prevent"]))
|
1384
1384
|
}, [
|
1385
1385
|
typeof u.value == "string" && u.value.length > 0 ? (v(), b("div", zr, D(u.value), 1)) : q("", !0),
|
1386
|
-
(v(!0), b(ee, null,
|
1387
|
-
var h, o,
|
1386
|
+
(v(!0), b(ee, null, fe(d.schema, (g) => {
|
1387
|
+
var h, o, m, $;
|
1388
1388
|
return v(), A(Tt, de((delete g.validators, g), {
|
1389
1389
|
key: g.name,
|
1390
|
-
error: (h = c(i)[g.name]) != null && h.$error ? ($ = (
|
1390
|
+
error: (h = c(i)[g.name]) != null && h.$error ? ($ = (m = (o = c(i)[g.name]) == null ? void 0 : o.$errors) == null ? void 0 : m[0]) == null ? void 0 : $.$message : "",
|
1391
1391
|
value: a.value[g.name],
|
1392
1392
|
onChange: (y) => g.type !== c(T).TEXT ? l(g.name, y) : void 0,
|
1393
1393
|
onInput: (y) => g.type === c(T).TEXT ? l(g.name, y) : void 0
|
@@ -1416,7 +1416,7 @@ const Dr = /* @__PURE__ */ j({
|
|
1416
1416
|
},
|
1417
1417
|
...t.templateColumns && { gridTemplateColumns: t.templateColumns }
|
1418
1418
|
});
|
1419
|
-
return (i, u) => (v(), A(
|
1419
|
+
return (i, u) => (v(), A(me(i.component), {
|
1420
1420
|
class: G(r),
|
1421
1421
|
style: ge(s)
|
1422
1422
|
}, {
|
@@ -1444,7 +1444,7 @@ const Jr = /* @__PURE__ */ j({
|
|
1444
1444
|
gridRow: `span ${t.spanRow} / span ${t.spanRow}`
|
1445
1445
|
}
|
1446
1446
|
});
|
1447
|
-
return (a, s) => (v(), A(
|
1447
|
+
return (a, s) => (v(), A(me(a.component), {
|
1448
1448
|
class: G(r),
|
1449
1449
|
style: ge(n)
|
1450
1450
|
}, {
|
@@ -1506,7 +1506,7 @@ const qr = /* @__PURE__ */ P("svg", {
|
|
1506
1506
|
class: G(n),
|
1507
1507
|
style: ge(r.isMobile ? { top: `${i.topPosition}px` } : {})
|
1508
1508
|
}, [
|
1509
|
-
(v(!0), b(ee, null,
|
1509
|
+
(v(!0), b(ee, null, fe(c(t), (l) => (v(), b("li", {
|
1510
1510
|
key: l.text,
|
1511
1511
|
class: "pdap-nav-link-container"
|
1512
1512
|
}, [
|
@@ -1611,15 +1611,13 @@ const en = /* @__PURE__ */ j({
|
|
1611
1611
|
value: ""
|
1612
1612
|
}
|
1613
1613
|
];
|
1614
|
-
function a({
|
1615
|
-
location: s
|
1616
|
-
|
1617
|
-
|
1618
|
-
if (s = s && s.length > 0 ? s : "all", i = i && i.length > 0 ? i : "all", t.getRoutes().some((u) => u.path.includes("/search/")))
|
1619
|
-
t.push(`/search/${i}/${s}`);
|
1614
|
+
function a(s) {
|
1615
|
+
let { location: i, searchTerm: u } = s;
|
1616
|
+
if (i = i && i.length > 0 ? i : "all", u = u && u.length > 0 ? u : "all", t.getRoutes().some((l) => l.path.includes("/search/")))
|
1617
|
+
t.push(`/search/${u}/${i}`);
|
1620
1618
|
else {
|
1621
|
-
const
|
1622
|
-
window.location.assign(`${
|
1619
|
+
const l = r.mode === "prod" ? "https://data-sources.pdap.io" : "https://data-sources.pdap.dev";
|
1620
|
+
window.location.assign(`${l}/search/${u}/${i}`);
|
1623
1621
|
}
|
1624
1622
|
}
|
1625
1623
|
return (s, i) => (v(), A(ke, {
|