(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.df-ui-lozenge[data-v-f6531cc4]{--lozenge-color: #000;--lozenge-border-color: var(--django-filtering-ui-tertiary);--lozenge-background-color: var(--django-filtering-ui-tertiary-shaded);display:flex;align-items:center;gap:.25em;padding:2px .75em;border-radius:10px;color:var(--lozenge-color);border:1px solid var(--lozenge-border-color);background-color:var(--lozenge-background-color)}.df-ui-lozenge-value[data-v-f6531cc4]{font-weight:700}.df-ui-lozenge-clear[data-v-f6531cc4]{text-decoration:none;color:var(--lozenge-border-color)}.df-ui-lozenge-clear[data-v-f6531cc4]:before{content:"|";margin-left:.25em}.df-ui-lozenge-clear[data-v-f6531cc4]:after{content:"×";margin-left:.5em}.df-ui-lozenges-form[data-v-b5a6cf70]{display:none}.df-ui-lozenges[data-v-b5a6cf70]{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;margin:20px 0;gap:5px}.df-ui-lozenges-preamble[data-v-b5a6cf70]{margin-right:5px}
.df-ui-debug-data[data-v-03e54b24]{margin:20px 0}.df-ui-debug-data-header[data-v-03e54b24]{display:flex}.df-ui-debug-data-header h4[data-v-03e54b24]{margin:0;flex:1}.df-ui-filtering[data-v-2b2d361b]{margin:30px 0}.df-ui-row.df-ui-match-type[data-v-2b2d361b]{margin:20px 0}.df-ui-row.df-ui-condition[data-v-2b2d361b]{display:flex;margin:10px 0;align-items:center;gap:10px}[data-v-2b2d361b] .df-ui-row.df-ui-condition .df-ui-col{flex:1}[data-v-2b2d361b] .df-ui-row.df-ui-condition input[type=text],[data-v-2b2d361b] .df-ui-row.df-ui-condition select{width:100%}[data-v-2b2d361b] .df-ui-row.df-ui-condition .df-ui-row-actions{display:flex;gap:5px;justify-content:right}.df-ui-form-actions[data-v-2b2d361b]{display:flex;gap:10px;margin:30px 0}
:root{--django-filtering-ui-primary-light: #fff;--django-filtering-ui-primary-dark: #000;--django-filtering-ui-primary: var(--django-filtering-ui-primary-light);--django-filtering-ui-primary-inverse: var( --django-filtering-ui-primary-dark );--django-filtering-ui-secondary: #ffc20e;--django-filtering-ui-secondary-shaded: rgba(255, 194, 14, .4);--django-filtering-ui-tertiary: #e07e26;--django-filtering-ui-tertiary-shaded: rgba(224, 126, 39, .2);--django-filtering-ui-shaded: #494948;--django-filtering-ui-shaded-more: #acacac}`)),document.head.appendChild(e)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
import{c as h,o,a as s,b as c,t as m,F as v,d as z,e as _,u as n,r as L,i as k,f as D,g as $,n as N,h as P,D as V}from"./assets/vendor-Bid8UQhM.js";import{_ as F,u as w,a as U}from"./assets/useQueryFilters-BikKtQ_8.js";const q={class:"df-ui-lozenge"},M=["data-value"],Q=["data-value"],G=["data-value"],H={__name:"Lozenge",props:["schema","condition","disableRemove"],setup(e){const u=h(()=>e.schema.filter(t=>t.name==e.condition.identifier)[0]),r=h(()=>u.value.lookups[e.condition.relative]),g=h(()=>r.value.label),f=()=>r.value.choices.filter(([t])=>t.toString()===e.condition.value)[0][1];return(t,i)=>(o(),s("div",q,[c("span",{class:"df-ui-lozenge-identifier","data-value":e.condition.identifier},m(u.value.label),9,M),c("span",{class:"df-ui-lozenge-relative","data-value":e.condition.relative},m(g.value),9,Q),c("span",{class:"df-ui-lozenge-value","data-value":e.condition.value},[u.value.lookups[e.condition.relative].type=="choice"?(o(),s(v,{key:0},[z(m(f()),1)],64)):(o(),s(v,{key:1},[z(m(e.condition.value),1)],64))],8,G),e.disableRemove?_("",!0):(o(),s("a",{key:0,class:"df-ui-lozenge-clear",href:"#",title:"clear",onClick:i[0]||(i[0]=y=>t.$emit("remove"))}))]))}},C=F(H,[["__scopeId","data-v-f6531cc4"]]),J={and:"all",or:"any",not:"none"},K=e=>J[e],W=["action"],X=["value"],Y=["value"],Z={key:0,class:"df-ui-lozenges"},ee={class:"df-ui-lozenges-preamble"},te={__name:"Listing",setup(e){const u=w(),r=k("filtering-options-schema");k("model-listing-url");const g=k("model-filtering-url"),f=D("filteringForm"),{grouping:t,stickies:i,changedStickies:y,rendered:B}=U({optionsSchema:r}),b=Object.entries(r.filters).map(([l,d])=>({name:l,...d})),E=t?K(t.operation):null,T=h(()=>!!(t.conditions.length||i.value.length)),R=()=>{N(()=>f.value.dispatchEvent(new Event("submit")))},I=l=>{t.removeConditions(l),R()},A=l=>{const d=i.value.findIndex(j=>j.id===l.id),[a,{lookup:p,value:O}]=r.filters[l.identifier].sticky_default;i.value[d].lookup=p,i.value[d].value=O,R()};return(l,d)=>(o(),s(v,null,[c("form",{class:"df-ui-lozenges-form",ref_key:"filteringForm",ref:f,method:"post",action:n(g)},[c("input",{type:"hidden",name:"csrfmiddlewaretoken",value:n(u)},null,8,X),c("input",{type:"hidden",name:"q",value:n(B)},null,8,Y)],8,W),T.value?(o(),s("div",Z,[c("span",ee,"Results match "+m(n(E))+" of:",1),(o(!0),s(v,null,L(n(i),a=>(o(),$(C,{key:a.id,condition:a,schema:n(b),disableRemove:!n(y).includes(a),onRemove:p=>A(a)},null,8,["condition","schema","disableRemove","onRemove"]))),128)),n(t)?(o(!0),s(v,{key:0},L(n(t).conditions,a=>(o(),$(C,{key:a.id,condition:a,schema:n(b),onRemove:p=>I(a)},null,8,["condition","schema","onRemove"]))),128)):_("",!0)])):_("",!0)],64))}},ne=F(te,[["__scopeId","data-v-b5a6cf70"]]),S=document.getElementById("vue-app"),x=P(ne);x.use(V,{rootElement:S});x.mount(S);
