1import{Q as v,b as g}from"./QSelect.4a7a82cb.js";import{P as u}from"./Player.a7302b4e.js";import{_ as E,D as x,n as B,x as M,o as f,g as y,f as _,F as N,h as Y,w as L,e as F,t as k,a as P,E as O}from"./index.2b547bdf.js";import"./QChip.48a7205d.js";import"./QItemSection.651b4d54.js";import"./QItemLabel.9869371e.js";import"./QMenu.38f15320.js";import"./position-engine.ed0e43e8.js";const w=[{label:"Clutch",field:"clutchTrait",type:"boolean",defaultValue:1},{label:"High Motor",field:"highMotorTrait",type:"boolean",defaultValue:1},{label:"Penalty",field:"penaltyTrait",type:"select",options:u.PENALTY,defaultValue:1},{label:"Predictable",field:"predictTrait",type:"boolean",defaultValue:1},{label:"QB Style",field:"qBStyleTrait",type:"select",options:u.QB_STYLE,defaultValue:0},{label:"Tight Spiral",field:"tightSpiralTrait",type:"boolean",defaultValue:1},{label:"Sense Pressure",field:"sensePressureTrait",type:"select",options:u.SENSE_PRESSURE,defaultValue:2},{label:"Throw Away",field:"throwAwayTrait",type:"boolean",defaultValue:1},{label:"Big Hitter",field:"bigHitTrait",type:"boolean",defaultValue:1},{label:"Strip Ball",field:"stripBallTrait",type:"boolean",defaultValue:1},{label:"Play Ball",field:"playBallTrait",type:"select",options:u.PLAY_BALL,defaultValue:1},{label:"Linebacker Style",field:"lBStyleTrait",type:"select",options:u.LB_STYLE,defaultValue:1},{label:"DL Spin Move",field:"dLSpinTrait",type:"boolean",defaultValue:1},{label:"DL Swim Move",field:"dLSwimTrait",type:"boolean",defaultValue:1},{label:"Bull Rush",field:"dLBullRushTrait",type:"boolean",defaultValue:1},{label:"Run Style",field:"runStyle",type:"select",options:u.RUN_STYLES,defaultValue:1},{label:"Cover Ball",field:"coverBallTrait",type:"select",options:u.COVER_BALL,defaultValue:1},{label:"Fight for Yards",field:"fightForYardsTrait",type:"boolean",defaultValue:1},{label:"Drop Open Passes",field:"dropOpenPassTrait",type:"boolean",defaultValue:1},{label:"Yards After Catch",field:"yACCatchTrait",type:"boolean",defaultValue:1},{label:"Possession Catch",field:"posCatchTrait",type:"boolean",defaultValue:1},{label:"Sideline Catch",field:"hPCatchTrait",type:"boolean",defaultValue:1}];function p(a){return w.find(n=>n.field===a)}function T(a){if(typeof a=="number"&&Number.isFinite(a))return Math.trunc(a);if(typeof a=="string"){const n=parseInt(a);if(Number.isFinite(n))return n}return 0}const R={props:{modelValue:{type:Array,required:!1,default:null}},emits:["update:modelValue"],setup(a,n){const b=x([]),o=B(()=>w.map(e=>({label:e.label,field:e.field}))),c=B(()=>{if(!Array.isArray(a.modelValue))return[];const e=new Set,l=[];for(const i of a.modelValue){if(!i||typeof i!="object")continue;const t=i.field;if(typeof t!="string"||t.length===0)continue;const r=p(t);if(!r||e.has(t))continue;e.add(t);const s=T(i.value);l.push({field:t,value:r.type==="boolean"?1:s})}return l});M(()=>a.modelValue,()=>{b.value=c.value.map(e=>e.field)},{immediate:!0,deep:!0});function h(e){const l=p(e);return l?l.label:e}function d(e){const l=p(e);return(l==null?void 0:l.type)==="select"}function m(e){const l=p(e);return!l||l.type!=="select"||!l.options?[]:l.options.map((i,t)=>({label:i,value:t}))}function A(e){const l=Array.isArray(e)?e:[];b.value=l;const i=c.value,t=new Map(i.map(s=>[s.field,s])),r=[];for(const s of l){const V=p(s);if(!V)continue;const S=t.get(s);S?r.push({field:s,value:V.type==="boolean"?1:T(S.value)}):r.push({field:s,value:V.defaultValue})}n.emit("update:modelValue",r.length?r:null)}function C(e,l){const i=p(e);if(!i||i.type!=="select")return;const t=c.value.map(r=>r.field!==e?r:{field:e,value:T(l)});n.emit("update:modelValue",t.length?t:null)}return{selectedFields:b,traitOptions:o,normalizedModel:c,getTraitLabel:h,isSelectTrait:d,getSelectOptions:m,onSelectedFieldsChange:A,updateTraitValue:C}}},D={key:0,class:"q-mt-xs"},I={class:"self-center full-width no-outline",tabindex:"0"};function U(a,n,b,o,c,h){return f(),y("div",null,[_(v,{"model-value":o.selectedFields,filled:"",dense:"","options-dense":"",options:o.traitOptions,label:"Traits","option-value":"field","option-label":"label","emit-value":"","map-options":"","use-chips":"",clearable:"",multiple:"","onUpdate:modelValue":o.onSelectedFieldsChange}
1,null,8,["model-value","options","onUpdate:modelValue"]),o.normalizedModel.length?(f(),y("div",D,[(f(!0),y(N,null,Y(o.normalizedModel,d=>(f(),y("div",{key:d.field,class:"q-gutter-xs row items-start q-mb-xs"},[_(g,{filled:"",dense:"",readonly:"",class:"col"},{control:L(()=>[F("div",I,k(o.getTraitLabel(d.field)),1)]),_:2},1024),o.isSelectTrait(d.field)?(f(),P(v,{key:0,"model-value":d.value,filled:"",dense:"",class:"col","options-dense":"",options:o.getSelectOptions(d.field),"option-label":"label","option-value":"value","emit-value":"","map-options":"","onUpdate:modelValue":m=>o.updateTraitValue(d.field,m)},null,8,["model-value","options","onUpdate:modelValue"])):(f(),P(g,{key:1,filled:"",dense:"",readonly:"",class:"col"},{control:L(()=>[...n[0]||(n[0]=[F("div",{class:"self-center full-width no-outline",tabindex:"0"}," Yes ",-1)])]),_:1}))]))),128))])):O("",!0)])}var W=E(R,[["render",U]]);export{W as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.