@9troisquarts/inline-filters 0.0.13 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/inline-filters.js
CHANGED
|
@@ -28986,7 +28986,7 @@ const tp = /* @__PURE__ */ or(Ete), { Title: Ste } = oY, { Option: Pte } = q_, G
|
|
|
28986
28986
|
marginBottom: 10
|
|
28987
28987
|
},
|
|
28988
28988
|
value: p,
|
|
28989
|
-
children: S(g).map((H, j) => /* @__PURE__ */ qe.jsx(
|
|
28989
|
+
children: S(g || []).map((H, j) => /* @__PURE__ */ qe.jsx(
|
|
28990
28990
|
Pte,
|
|
28991
28991
|
{
|
|
28992
28992
|
value: H,
|
|
@@ -234,4 +234,4 @@ __p += '`),tn&&(Me+=`' +
|
|
|
234
234
|
function print() { __p += __j.call(arguments, '') }
|
|
235
235
|
`:`;
|
|
236
236
|
`)+Me+`return __p
|
|
237
|
-
}`;var Bt=JP(function(){return ln(q,dt+"return "+Me).apply(n,J)});if(Bt.source=Me,Bm(Bt))throw Bt;return Bt}function Cee(i){return fn(i).toLowerCase()}function bee(i){return fn(i).toUpperCase()}function xee(i,u,h){if(i=fn(i),i&&(h||u===n))return u2(i);if(!i||!(u=Wr(u)))return i;var w=wa(i),I=wa(u),q=s2(w,I),J=c2(w,I)+1;return yi(w,q,J).join("")}function wee(i,u,h){if(i=fn(i),i&&(h||u===n))return i.slice(0,d2(i)+1);if(!i||!(u=Wr(u)))return i;var w=wa(i),I=c2(w,wa(u))+1;return yi(w,0,I).join("")}function _ee(i,u,h){if(i=fn(i),i&&(h||u===n))return i.replace(pt,"");if(!i||!(u=Wr(u)))return i;var w=wa(i),I=s2(w,wa(u));return yi(w,I).join("")}function Eee(i,u){var h=V,w=B;if(Mn(u)){var I="separator"in u?u.separator:I;h="length"in u?Wt(u.length):h,w="omission"in u?Wr(u.omission):w}i=fn(i);var q=i.length;if(Uo(i)){var J=wa(i);q=J.length}if(h>=q)return i;var ae=h-Yo(w);if(ae<1)return w;var ce=J?yi(J,0,ae).join(""):i.slice(0,ae);if(I===n)return ce+w;if(J&&(ae+=ce.length-ae),Um(I)){if(i.slice(ae).search(I)){var Se,Pe=ce;for(I.global||(I=lm(I.source,fn(Ne.exec(I))+"g")),I.lastIndex=0;Se=I.exec(Pe);)var Me=Se.index;ce=ce.slice(0,Me===n?ae:Me)}}else if(i.indexOf(Wr(I),ae)!=ae){var Ke=ce.lastIndexOf(I);Ke>-1&&(ce=ce.slice(0,Ke))}return ce+w}function See(i){return i=fn(i),i&&it.test(i)?i.replace(mt,eG):i}var Pee=Jo(function(i,u,h){return i+(h?" ":"")+u.toUpperCase()}),Km=eP("toUpperCase");function QP(i,u,h){return i=fn(i),u=h?n:u,u===n?GK(i)?rG(i):Ht(i):i.match(u)||[]}var JP=Yt(function(i,u){try{return or(i,n,u)}catch(h){return Bm(h)?h:new Lt(h)}}),Oee=Xa(function(i,u){return _r(u,function(h){h=$a(h),Ka(i,h,jm(i[h],i))}),i});function Nee(i){var u=i==null?0:i.length,h=Pt();return i=u?yn(i,function(w){if(typeof w[1]!="function")throw new na(l);return[h(w[0]),w[1]]}):[],Yt(function(w){for(var I=-1;++I<u;){var q=i[I];if(or(q[0],this,w))return or(q[1],this,w)}})}function Mee(i){return eX(aa(i,v))}function Gm(i){return function(){return i}}function Ree(i,u){return i==null||i!==i?u:i}var Tee=nP(),kee=nP(!0);function Or(i){return i}function Xm(i){return k2(typeof i=="function"?i:aa(i,v))}function Iee(i){return D2(aa(i,v))}function Dee(i,u){return A2(i,aa(u,v))}var Aee=Yt(function(i,u){return function(h){return Cu(h,i,u)}}),$ee=Yt(function(i,u){return function(h){return Cu(i,h,u)}});function Zm(i,u,h){var w=Kn(u),I=Pf(u,w);h==null&&!(Mn(u)&&(I.length||!w.length))&&(h=u,u=i,i=this,I=Pf(u,Kn(u)));var q=!(Mn(h)&&"chain"in h)||!!h.chain,J=Qa(i);return _r(I,function(ae){var ce=u[ae];i[ae]=ce,J&&(i.prototype[ae]=function(){var Se=this.__chain__;if(q||Se){var Pe=i(this.__wrapped__),Me=Pe.__actions__=Er(this.__actions__);return Me.push({func:ce,args:arguments,thisArg:i}),Pe.__chain__=Se,Pe}return ce.apply(i,Jr([this.value()],arguments))})}),i}function Lee(){return jn._===this&&(jn._=sG),this}function Qm(){}function Fee(i){return i=Wt(i),Yt(function(u){return $2(u,i)})}var Vee=Mm(yn),zee=Mm(uf),Wee=Mm(At);function eO(i){return $m(i)?Ua($a(i)):gX(i)}function jee(i){return function(u){return i==null?n:Qi(i,u)}}var Hee=aP(),Bee=aP(!0);function Jm(){return[]}function eg(){return!1}function Uee(){return{}}function Yee(){return""}function qee(){return!0}function Kee(i,u){if(i=Wt(i),i<1||i>N)return[];var h=z,w=ur(i,z);u=Pt(u),i-=z;for(var I=am(w,u);++h<i;)u(h);return I}function Gee(i){return zt(i)?yn(i,$a):jr(i)?[i]:Er(bP(fn(i)))}function Xee(i){var u=++lG;return fn(i)+u}var Zee=kf(function(i,u){return i+u},0),Qee=Rm("ceil"),Jee=kf(function(i,u){return i/u},1),ete=Rm("floor");function tte(i){return i&&i.length?Sf(i,Or,hm):n}function nte(i,u){return i&&i.length?Sf(i,Pt(u,2),hm):n}function rte(i){return ta(i,Or)}function ate(i,u){return ta(i,Pt(u,2))}function ite(i){return i&&i.length?Sf(i,Or,Cm):n}function ote(i,u){return i&&i.length?Sf(i,Pt(u,2),Cm):n}var lte=kf(function(i,u){return i*u},1),ute=Rm("round"),ste=kf(function(i,u){return i-u},0);function cte(i){return i&&i.length?rm(i,Or):0}function fte(i,u){return i&&i.length?rm(i,Pt(u,2)):0}return Y.after=IQ,Y.ary=TP,Y.assign=bJ,Y.assignIn=UP,Y.assignInWith=Uf,Y.assignWith=xJ,Y.at=wJ,Y.before=kP,Y.bind=jm,Y.bindAll=Oee,Y.bindKey=IP,Y.castArray=UQ,Y.chain=NP,Y.chunk=eZ,Y.compact=tZ,Y.concat=nZ,Y.cond=Nee,Y.conforms=Mee,Y.constant=Gm,Y.countBy=cQ,Y.create=_J,Y.curry=DP,Y.curryRight=AP,Y.debounce=$P,Y.defaults=EJ,Y.defaultsDeep=SJ,Y.defer=DQ,Y.delay=AQ,Y.difference=rZ,Y.differenceBy=aZ,Y.differenceWith=iZ,Y.drop=oZ,Y.dropRight=lZ,Y.dropRightWhile=uZ,Y.dropWhile=sZ,Y.fill=cZ,Y.filter=dQ,Y.flatMap=hQ,Y.flatMapDeep=mQ,Y.flatMapDepth=gQ,Y.flatten=EP,Y.flattenDeep=fZ,Y.flattenDepth=dZ,Y.flip=$Q,Y.flow=Tee,Y.flowRight=kee,Y.fromPairs=vZ,Y.functions=kJ,Y.functionsIn=IJ,Y.groupBy=yQ,Y.initial=hZ,Y.intersection=mZ,Y.intersectionBy=gZ,Y.intersectionWith=yZ,Y.invert=AJ,Y.invertBy=$J,Y.invokeMap=bQ,Y.iteratee=Xm,Y.keyBy=xQ,Y.keys=Kn,Y.keysIn=Pr,Y.map=Vf,Y.mapKeys=FJ,Y.mapValues=VJ,Y.matches=Iee,Y.matchesProperty=Dee,Y.memoize=Wf,Y.merge=zJ,Y.mergeWith=YP,Y.method=Aee,Y.methodOf=$ee,Y.mixin=Zm,Y.negate=jf,Y.nthArg=Fee,Y.omit=WJ,Y.omitBy=jJ,Y.once=LQ,Y.orderBy=wQ,Y.over=Vee,Y.overArgs=FQ,Y.overEvery=zee,Y.overSome=Wee,Y.partial=Hm,Y.partialRight=LP,Y.partition=_Q,Y.pick=HJ,Y.pickBy=qP,Y.property=eO,Y.propertyOf=jee,Y.pull=wZ,Y.pullAll=PP,Y.pullAllBy=_Z,Y.pullAllWith=EZ,Y.pullAt=SZ,Y.range=Hee,Y.rangeRight=Bee,Y.rearg=VQ,Y.reject=PQ,Y.remove=PZ,Y.rest=zQ,Y.reverse=zm,Y.sampleSize=NQ,Y.set=UJ,Y.setWith=YJ,Y.shuffle=MQ,Y.slice=OZ,Y.sortBy=kQ,Y.sortedUniq=DZ,Y.sortedUniqBy=AZ,Y.split=hee,Y.spread=WQ,Y.tail=$Z,Y.take=LZ,Y.takeRight=FZ,Y.takeRightWhile=VZ,Y.takeWhile=zZ,Y.tap=tQ,Y.throttle=jQ,Y.thru=Ff,Y.toArray=jP,Y.toPairs=KP,Y.toPairsIn=GP,Y.toPath=Gee,Y.toPlainObject=BP,Y.transform=qJ,Y.unary=HQ,Y.union=WZ,Y.unionBy=jZ,Y.unionWith=HZ,Y.uniq=BZ,Y.uniqBy=UZ,Y.uniqWith=YZ,Y.unset=KJ,Y.unzip=Wm,Y.unzipWith=OP,Y.update=GJ,Y.updateWith=XJ,Y.values=nl,Y.valuesIn=ZJ,Y.without=qZ,Y.words=QP,Y.wrap=BQ,Y.xor=KZ,Y.xorBy=GZ,Y.xorWith=XZ,Y.zip=ZZ,Y.zipObject=QZ,Y.zipObjectDeep=JZ,Y.zipWith=eQ,Y.entries=KP,Y.entriesIn=GP,Y.extend=UP,Y.extendWith=Uf,Zm(Y,Y),Y.add=Zee,Y.attempt=JP,Y.camelCase=tee,Y.capitalize=XP,Y.ceil=Qee,Y.clamp=QJ,Y.clone=YQ,Y.cloneDeep=KQ,Y.cloneDeepWith=GQ,Y.cloneWith=qQ,Y.conformsTo=XQ,Y.deburr=ZP,Y.defaultTo=Ree,Y.divide=Jee,Y.endsWith=nee,Y.eq=Ea,Y.escape=ree,Y.escapeRegExp=aee,Y.every=fQ,Y.find=vQ,Y.findIndex=wP,Y.findKey=PJ,Y.findLast=pQ,Y.findLastIndex=_P,Y.findLastKey=OJ,Y.floor=ete,Y.forEach=MP,Y.forEachRight=RP,Y.forIn=NJ,Y.forInRight=MJ,Y.forOwn=RJ,Y.forOwnRight=TJ,Y.get=Ym,Y.gt=ZQ,Y.gte=QQ,Y.has=DJ,Y.hasIn=qm,Y.head=SP,Y.identity=Or,Y.includes=CQ,Y.indexOf=pZ,Y.inRange=JJ,Y.invoke=LJ,Y.isArguments=to,Y.isArray=zt,Y.isArrayBuffer=JQ,Y.isArrayLike=Sr,Y.isArrayLikeObject=An,Y.isBoolean=eJ,Y.isBuffer=Ci,Y.isDate=tJ,Y.isElement=nJ,Y.isEmpty=rJ,Y.isEqual=aJ,Y.isEqualWith=iJ,Y.isError=Bm,Y.isFinite=oJ,Y.isFunction=Qa,Y.isInteger=FP,Y.isLength=Hf,Y.isMap=VP,Y.isMatch=lJ,Y.isMatchWith=uJ,Y.isNaN=sJ,Y.isNative=cJ,Y.isNil=dJ,Y.isNull=fJ,Y.isNumber=zP,Y.isObject=Mn,Y.isObjectLike=Tn,Y.isPlainObject=Su,Y.isRegExp=Um,Y.isSafeInteger=vJ,Y.isSet=WP,Y.isString=Bf,Y.isSymbol=jr,Y.isTypedArray=tl,Y.isUndefined=pJ,Y.isWeakMap=hJ,Y.isWeakSet=mJ,Y.join=CZ,Y.kebabCase=iee,Y.last=oa,Y.lastIndexOf=bZ,Y.lowerCase=oee,Y.lowerFirst=lee,Y.lt=gJ,Y.lte=yJ,Y.max=tte,Y.maxBy=nte,Y.mean=rte,Y.meanBy=ate,Y.min=ite,Y.minBy=ote,Y.stubArray=Jm,Y.stubFalse=eg,Y.stubObject=Uee,Y.stubString=Yee,Y.stubTrue=qee,Y.multiply=lte,Y.nth=xZ,Y.noConflict=Lee,Y.noop=Qm,Y.now=zf,Y.pad=uee,Y.padEnd=see,Y.padStart=cee,Y.parseInt=fee,Y.random=eee,Y.reduce=EQ,Y.reduceRight=SQ,Y.repeat=dee,Y.replace=vee,Y.result=BJ,Y.round=ute,Y.runInContext=ue,Y.sample=OQ,Y.size=RQ,Y.snakeCase=pee,Y.some=TQ,Y.sortedIndex=NZ,Y.sortedIndexBy=MZ,Y.sortedIndexOf=RZ,Y.sortedLastIndex=TZ,Y.sortedLastIndexBy=kZ,Y.sortedLastIndexOf=IZ,Y.startCase=mee,Y.startsWith=gee,Y.subtract=ste,Y.sum=cte,Y.sumBy=fte,Y.template=yee,Y.times=Kee,Y.toFinite=Ja,Y.toInteger=Wt,Y.toLength=HP,Y.toLower=Cee,Y.toNumber=la,Y.toSafeInteger=CJ,Y.toString=fn,Y.toUpper=bee,Y.trim=xee,Y.trimEnd=wee,Y.trimStart=_ee,Y.truncate=Eee,Y.unescape=See,Y.uniqueId=Xee,Y.upperCase=Pee,Y.upperFirst=Km,Y.each=MP,Y.eachRight=RP,Y.first=SP,Zm(Y,function(){var i={};return Da(Y,function(u,h){pn.call(Y.prototype,h)||(i[h]=u)}),i}(),{chain:!1}),Y.VERSION=r,_r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){Y[i].placeholder=Y}),_r(["drop","take"],function(i,u){Qt.prototype[i]=function(h){h=h===n?1:Bn(Wt(h),0);var w=this.__filtered__&&!u?new Qt(this):this.clone();return w.__filtered__?w.__takeCount__=ur(h,w.__takeCount__):w.__views__.push({size:ur(h,z),type:i+(w.__dir__<0?"Right":"")}),w},Qt.prototype[i+"Right"]=function(h){return this.reverse()[i](h).reverse()}}),_r(["filter","map","takeWhile"],function(i,u){var h=u+1,w=h==F||h==D;Qt.prototype[i]=function(I){var q=this.clone();return q.__iteratees__.push({iteratee:Pt(I,3),type:h}),q.__filtered__=q.__filtered__||w,q}}),_r(["head","last"],function(i,u){var h="take"+(u?"Right":"");Qt.prototype[i]=function(){return this[h](1).value()[0]}}),_r(["initial","tail"],function(i,u){var h="drop"+(u?"":"Right");Qt.prototype[i]=function(){return this.__filtered__?new Qt(this):this[h](1)}}),Qt.prototype.compact=function(){return this.filter(Or)},Qt.prototype.find=function(i){return this.filter(i).head()},Qt.prototype.findLast=function(i){return this.reverse().find(i)},Qt.prototype.invokeMap=Yt(function(i,u){return typeof i=="function"?new Qt(this):this.map(function(h){return Cu(h,i,u)})}),Qt.prototype.reject=function(i){return this.filter(jf(Pt(i)))},Qt.prototype.slice=function(i,u){i=Wt(i);var h=this;return h.__filtered__&&(i>0||u<0)?new Qt(h):(i<0?h=h.takeRight(-i):i&&(h=h.drop(i)),u!==n&&(u=Wt(u),h=u<0?h.dropRight(-u):h.take(u-i)),h)},Qt.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Qt.prototype.toArray=function(){return this.take(z)},Da(Qt.prototype,function(i,u){var h=/^(?:filter|find|map|reject)|While$/.test(u),w=/^(?:head|last)$/.test(u),I=Y[w?"take"+(u=="last"?"Right":""):u],q=w||/^find/.test(u);I&&(Y.prototype[u]=function(){var J=this.__wrapped__,ae=w?[1]:arguments,ce=J instanceof Qt,Se=ae[0],Pe=ce||zt(J),Me=function(Gt){var tn=I.apply(Y,Jr([Gt],ae));return w&&Ke?tn[0]:tn};Pe&&h&&typeof Se=="function"&&Se.length!=1&&(ce=Pe=!1);var Ke=this.__chain__,dt=!!this.__actions__.length,Nt=q&&!Ke,Bt=ce&&!dt;if(!q&&Pe){J=Bt?J:new Qt(this);var Mt=i.apply(J,ae);return Mt.__actions__.push({func:Ff,args:[Me],thisArg:n}),new ra(Mt,Ke)}return Nt&&Bt?i.apply(this,ae):(Mt=this.thru(Me),Nt?w?Mt.value()[0]:Mt.value():Mt)})}),_r(["pop","push","shift","sort","splice","unshift"],function(i){var u=cf[i],h=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",w=/^(?:pop|shift)$/.test(i);Y.prototype[i]=function(){var I=arguments;if(w&&!this.__chain__){var q=this.value();return u.apply(zt(q)?q:[],I)}return this[h](function(J){return u.apply(zt(J)?J:[],I)})}}),Da(Qt.prototype,function(i,u){var h=Y[u];if(h){var w=h.name+"";pn.call(Xo,w)||(Xo[w]=[]),Xo[w].push({name:u,func:h})}}),Xo[Tf(n,x).name]=[{name:"wrapper",func:n}],Qt.prototype.clone=SG,Qt.prototype.reverse=PG,Qt.prototype.value=OG,Y.prototype.at=nQ,Y.prototype.chain=rQ,Y.prototype.commit=aQ,Y.prototype.next=iQ,Y.prototype.plant=lQ,Y.prototype.reverse=uQ,Y.prototype.toJSON=Y.prototype.valueOf=Y.prototype.value=sQ,Y.prototype.first=Y.prototype.head,du&&(Y.prototype[du]=oQ),Y},qo=aG();Ia?((Ia.exports=qo)._=qo,jo._=qo):jn._=qo}).call(Fn)}(Hc,Hc.exports);var FK=Hc.exports;const Uh=Gn(FK),{Title:VK}=x9,{Option:zK}=jb,nu={keywords:[],matchType:"all"},WK={date:mU,string:LK,boolean:zB,daterange:IK,select:o2,keywords:e=>{var k,U,V;const{field:t,value:n,onChange:r}=e,{inputProps:{loadOptions:a,i18n:o}={}}=t.input||{},[l,s]=W.useState(!1),[c,f]=W.useState(n||nu),[p,v]=W.useState(""),m=lN(p,{wait:200}),[g,C]=W.useState([]),[b,y]=W.useState(!1);W.useEffect(()=>{R()},[l]),W.useEffect(()=>{n||f(nu)},[n]),W.useEffect(()=>{m!==""&&m!==void 0&&typeof a=="function"&&(y(!0),a({keywords:[...(c==null?void 0:c.keywords)||[],m],matchType:(c==null?void 0:c.matchType)||"all"}).then(B=>{y(!1),C(B)}))},[m]);const x=[{key:"0",label:(o==null?void 0:o.allText)||"all",onClick:()=>f({...c,matchType:"all"})},{key:"1",label:(o==null?void 0:o.anyText)||"any",onClick:()=>f({...c,matchType:"any"})}],_=B=>{var F;const H=new RegExp(`\\b(${(F=(c==null?void 0:c.keywords)||[])==null?void 0:F.join("|")})\\b`,"gi"),L=B.split(H);return Ye.jsx(W.Fragment,{children:L.map((j,D)=>H.test(j)?Ye.jsx("b",{children:j},D):Ye.jsx("span",{children:j},D))})},E=()=>{f(nu),v(""),C([]),y(!1),r({[t.name]:{keywords:[],matchType:"all"}})},R=()=>{f(n||nu),v(""),C([]),y(!1)},S=B=>B==null?void 0:B.filter(H=>{var L;return!((L=c==null?void 0:c.keywords)!=null&&L.includes(H))}),P=()=>(c==null?void 0:c.matchType)==="all"?(o==null?void 0:o.allText)||"all":(o==null?void 0:o.anyText)||"any",O=Ye.jsxs("div",{className:"wand__inline-filter__keywords__popover-content",children:[Ye.jsx(VK,{level:5,children:t==null?void 0:t.label}),Ye.jsxs("div",{className:"wand__inline-filter__match-type",children:[Ye.jsx("div",{children:(o==null?void 0:o.matchText)||"Matches"}),Ye.jsx(V1,{menu:{items:x},trigger:["click"],children:Ye.jsx("a",{onClick:B=>B.preventDefault(),children:Ye.jsxs("span",{children:[P()," ",Ye.jsx(Lb,{style:{fontSize:"12px"}})]})})}),Ye.jsx("div",{children:(o==null?void 0:o.keywordsText)||"of theses keywords :"})]}),Ye.jsx("div",{className:"wand__inline-filter__keywords__popover__keyword-list",children:(k=c==null?void 0:c.keywords)==null?void 0:k.map((B,H)=>Ye.jsxs("div",{className:"wand__inline-filter__keywords__popover__keyword",children:[Ye.jsx("div",{children:B}),Ye.jsx(K6,{onClick:()=>{var L;return f({...c,keywords:(L=c==null?void 0:c.keywords)==null?void 0:L.filter((F,j)=>j!==H)})}})]},H))}),Ye.jsx(jb,{className:"wand__inline-filter__search-input",showSearch:!0,placeholder:"Add a keyword",loading:b,onSearch:B=>{v(B||"")},onChange:B=>{v(""),C([]),f({...c,keywords:[...(c==null?void 0:c.keywords)||[],B]})},style:{width:"100%",marginBottom:10},value:p,children:S(g).map((B,H)=>Ye.jsx(zK,{value:B,children:_(B)},H))}),Ye.jsxs("div",{className:"wand__inline-filter__keywords__popover-footer",children:[Ye.jsx("div",{children:Ye.jsx("a",{onClick:E,children:(o==null?void 0:o.clearText)||"Clear"})}),Ye.jsxs("div",{className:"wand__inline-filter__keywords__popover-footer-right",children:[Ye.jsx(za,{type:"link",onClick:()=>{f(n||nu),s(!1)},children:(o==null?void 0:o.cancelText)||"Cancel"}),Ye.jsx(za,{type:"primary",onClick:()=>{r({[t.name]:c}),s(!1)},disabled:Uh.isEqual(Uh.sortBy(n),Uh.sortBy(c)),children:(o==null?void 0:o.searchText)||"Search"})]})]})]});return Ye.jsx("div",{className:"wand__inline-filter__keywords",children:Ye.jsx(Wv,{showArrow:!1,open:l,content:O,placement:"bottom",onOpenChange:s,trigger:"click",overlayClassName:"wand__inline-filter__popover",overlayStyle:{width:"500px"},children:Ye.jsx("div",{className:"wand__inline-filter__filter",children:Ye.jsxs(ga,{children:[Ye.jsx("span",{className:"wand__inline-filter__label",children:t.label}),c!=null&&c.keywords&&((U=c==null?void 0:c.keywords)==null?void 0:U.length)>0?Ye.jsx(Jb,{className:"wand__inline-filter__badge",count:(V=c==null?void 0:c.keywords)==null?void 0:V.length}):t.icon]})})})})}};return e=>{const{schema:t,value:n=void 0,defaultValue:r={},debug:a=!1,delay:o=200,resetText:l,toggle:s,onReset:c}=e,[f,p]=Qk(s!=null&&s.key?`${s==null?void 0:s.key}-filters`:"filter-toggle"),[v,m]=W.useState(n||r);W.useEffect(()=>{n&&m(n)},[n]);const g=()=>{c&&(n||m({}),c())},{run:C}=hg(E=>{e.onChange&&e.onChange(E)},{wait:o}),b=E=>{m(E),C(E)},y=E=>b(mw({...v,...E},s?f:[])),x=E=>{p(E),b(mw({...v},s?E:[]))};let _=t;return s&&f&&f.length>0&&(_=_.filter(E=>E.toggleable!==void 0&&!E.toggleable||!f.includes(Array.isArray(E.name)?E.name.join("//="):E.name))),Ye.jsxs(ga,{style:{width:"100%"},wrap:!0,children:[_.map(E=>{const R=WK[E.input.type]||o2;return Ye.jsx(R,{field:E,value:Array.isArray(E.name)?E.name.reduce((S,P)=>(S[P]=v[P],S),{}):v[E.name],onChange:y},Array.isArray(E.name)?E.name.join("--"):E.name)}),s&&Ye.jsx(VB,{schema:t,value:f,onChange:x,...s||{}}),c&&Ye.jsx(za,{type:"text",onClick:g,children:l||"Reset filters"})]})}});
|
|
237
|
+
}`;var Bt=JP(function(){return ln(q,dt+"return "+Me).apply(n,J)});if(Bt.source=Me,Bm(Bt))throw Bt;return Bt}function Cee(i){return fn(i).toLowerCase()}function bee(i){return fn(i).toUpperCase()}function xee(i,u,h){if(i=fn(i),i&&(h||u===n))return u2(i);if(!i||!(u=Wr(u)))return i;var w=wa(i),I=wa(u),q=s2(w,I),J=c2(w,I)+1;return yi(w,q,J).join("")}function wee(i,u,h){if(i=fn(i),i&&(h||u===n))return i.slice(0,d2(i)+1);if(!i||!(u=Wr(u)))return i;var w=wa(i),I=c2(w,wa(u))+1;return yi(w,0,I).join("")}function _ee(i,u,h){if(i=fn(i),i&&(h||u===n))return i.replace(pt,"");if(!i||!(u=Wr(u)))return i;var w=wa(i),I=s2(w,wa(u));return yi(w,I).join("")}function Eee(i,u){var h=V,w=B;if(Mn(u)){var I="separator"in u?u.separator:I;h="length"in u?Wt(u.length):h,w="omission"in u?Wr(u.omission):w}i=fn(i);var q=i.length;if(Uo(i)){var J=wa(i);q=J.length}if(h>=q)return i;var ae=h-Yo(w);if(ae<1)return w;var ce=J?yi(J,0,ae).join(""):i.slice(0,ae);if(I===n)return ce+w;if(J&&(ae+=ce.length-ae),Um(I)){if(i.slice(ae).search(I)){var Se,Pe=ce;for(I.global||(I=lm(I.source,fn(Ne.exec(I))+"g")),I.lastIndex=0;Se=I.exec(Pe);)var Me=Se.index;ce=ce.slice(0,Me===n?ae:Me)}}else if(i.indexOf(Wr(I),ae)!=ae){var Ke=ce.lastIndexOf(I);Ke>-1&&(ce=ce.slice(0,Ke))}return ce+w}function See(i){return i=fn(i),i&&it.test(i)?i.replace(mt,eG):i}var Pee=Jo(function(i,u,h){return i+(h?" ":"")+u.toUpperCase()}),Km=eP("toUpperCase");function QP(i,u,h){return i=fn(i),u=h?n:u,u===n?GK(i)?rG(i):Ht(i):i.match(u)||[]}var JP=Yt(function(i,u){try{return or(i,n,u)}catch(h){return Bm(h)?h:new Lt(h)}}),Oee=Xa(function(i,u){return _r(u,function(h){h=$a(h),Ka(i,h,jm(i[h],i))}),i});function Nee(i){var u=i==null?0:i.length,h=Pt();return i=u?yn(i,function(w){if(typeof w[1]!="function")throw new na(l);return[h(w[0]),w[1]]}):[],Yt(function(w){for(var I=-1;++I<u;){var q=i[I];if(or(q[0],this,w))return or(q[1],this,w)}})}function Mee(i){return eX(aa(i,v))}function Gm(i){return function(){return i}}function Ree(i,u){return i==null||i!==i?u:i}var Tee=nP(),kee=nP(!0);function Or(i){return i}function Xm(i){return k2(typeof i=="function"?i:aa(i,v))}function Iee(i){return D2(aa(i,v))}function Dee(i,u){return A2(i,aa(u,v))}var Aee=Yt(function(i,u){return function(h){return Cu(h,i,u)}}),$ee=Yt(function(i,u){return function(h){return Cu(i,h,u)}});function Zm(i,u,h){var w=Kn(u),I=Pf(u,w);h==null&&!(Mn(u)&&(I.length||!w.length))&&(h=u,u=i,i=this,I=Pf(u,Kn(u)));var q=!(Mn(h)&&"chain"in h)||!!h.chain,J=Qa(i);return _r(I,function(ae){var ce=u[ae];i[ae]=ce,J&&(i.prototype[ae]=function(){var Se=this.__chain__;if(q||Se){var Pe=i(this.__wrapped__),Me=Pe.__actions__=Er(this.__actions__);return Me.push({func:ce,args:arguments,thisArg:i}),Pe.__chain__=Se,Pe}return ce.apply(i,Jr([this.value()],arguments))})}),i}function Lee(){return jn._===this&&(jn._=sG),this}function Qm(){}function Fee(i){return i=Wt(i),Yt(function(u){return $2(u,i)})}var Vee=Mm(yn),zee=Mm(uf),Wee=Mm(At);function eO(i){return $m(i)?Ua($a(i)):gX(i)}function jee(i){return function(u){return i==null?n:Qi(i,u)}}var Hee=aP(),Bee=aP(!0);function Jm(){return[]}function eg(){return!1}function Uee(){return{}}function Yee(){return""}function qee(){return!0}function Kee(i,u){if(i=Wt(i),i<1||i>N)return[];var h=z,w=ur(i,z);u=Pt(u),i-=z;for(var I=am(w,u);++h<i;)u(h);return I}function Gee(i){return zt(i)?yn(i,$a):jr(i)?[i]:Er(bP(fn(i)))}function Xee(i){var u=++lG;return fn(i)+u}var Zee=kf(function(i,u){return i+u},0),Qee=Rm("ceil"),Jee=kf(function(i,u){return i/u},1),ete=Rm("floor");function tte(i){return i&&i.length?Sf(i,Or,hm):n}function nte(i,u){return i&&i.length?Sf(i,Pt(u,2),hm):n}function rte(i){return ta(i,Or)}function ate(i,u){return ta(i,Pt(u,2))}function ite(i){return i&&i.length?Sf(i,Or,Cm):n}function ote(i,u){return i&&i.length?Sf(i,Pt(u,2),Cm):n}var lte=kf(function(i,u){return i*u},1),ute=Rm("round"),ste=kf(function(i,u){return i-u},0);function cte(i){return i&&i.length?rm(i,Or):0}function fte(i,u){return i&&i.length?rm(i,Pt(u,2)):0}return Y.after=IQ,Y.ary=TP,Y.assign=bJ,Y.assignIn=UP,Y.assignInWith=Uf,Y.assignWith=xJ,Y.at=wJ,Y.before=kP,Y.bind=jm,Y.bindAll=Oee,Y.bindKey=IP,Y.castArray=UQ,Y.chain=NP,Y.chunk=eZ,Y.compact=tZ,Y.concat=nZ,Y.cond=Nee,Y.conforms=Mee,Y.constant=Gm,Y.countBy=cQ,Y.create=_J,Y.curry=DP,Y.curryRight=AP,Y.debounce=$P,Y.defaults=EJ,Y.defaultsDeep=SJ,Y.defer=DQ,Y.delay=AQ,Y.difference=rZ,Y.differenceBy=aZ,Y.differenceWith=iZ,Y.drop=oZ,Y.dropRight=lZ,Y.dropRightWhile=uZ,Y.dropWhile=sZ,Y.fill=cZ,Y.filter=dQ,Y.flatMap=hQ,Y.flatMapDeep=mQ,Y.flatMapDepth=gQ,Y.flatten=EP,Y.flattenDeep=fZ,Y.flattenDepth=dZ,Y.flip=$Q,Y.flow=Tee,Y.flowRight=kee,Y.fromPairs=vZ,Y.functions=kJ,Y.functionsIn=IJ,Y.groupBy=yQ,Y.initial=hZ,Y.intersection=mZ,Y.intersectionBy=gZ,Y.intersectionWith=yZ,Y.invert=AJ,Y.invertBy=$J,Y.invokeMap=bQ,Y.iteratee=Xm,Y.keyBy=xQ,Y.keys=Kn,Y.keysIn=Pr,Y.map=Vf,Y.mapKeys=FJ,Y.mapValues=VJ,Y.matches=Iee,Y.matchesProperty=Dee,Y.memoize=Wf,Y.merge=zJ,Y.mergeWith=YP,Y.method=Aee,Y.methodOf=$ee,Y.mixin=Zm,Y.negate=jf,Y.nthArg=Fee,Y.omit=WJ,Y.omitBy=jJ,Y.once=LQ,Y.orderBy=wQ,Y.over=Vee,Y.overArgs=FQ,Y.overEvery=zee,Y.overSome=Wee,Y.partial=Hm,Y.partialRight=LP,Y.partition=_Q,Y.pick=HJ,Y.pickBy=qP,Y.property=eO,Y.propertyOf=jee,Y.pull=wZ,Y.pullAll=PP,Y.pullAllBy=_Z,Y.pullAllWith=EZ,Y.pullAt=SZ,Y.range=Hee,Y.rangeRight=Bee,Y.rearg=VQ,Y.reject=PQ,Y.remove=PZ,Y.rest=zQ,Y.reverse=zm,Y.sampleSize=NQ,Y.set=UJ,Y.setWith=YJ,Y.shuffle=MQ,Y.slice=OZ,Y.sortBy=kQ,Y.sortedUniq=DZ,Y.sortedUniqBy=AZ,Y.split=hee,Y.spread=WQ,Y.tail=$Z,Y.take=LZ,Y.takeRight=FZ,Y.takeRightWhile=VZ,Y.takeWhile=zZ,Y.tap=tQ,Y.throttle=jQ,Y.thru=Ff,Y.toArray=jP,Y.toPairs=KP,Y.toPairsIn=GP,Y.toPath=Gee,Y.toPlainObject=BP,Y.transform=qJ,Y.unary=HQ,Y.union=WZ,Y.unionBy=jZ,Y.unionWith=HZ,Y.uniq=BZ,Y.uniqBy=UZ,Y.uniqWith=YZ,Y.unset=KJ,Y.unzip=Wm,Y.unzipWith=OP,Y.update=GJ,Y.updateWith=XJ,Y.values=nl,Y.valuesIn=ZJ,Y.without=qZ,Y.words=QP,Y.wrap=BQ,Y.xor=KZ,Y.xorBy=GZ,Y.xorWith=XZ,Y.zip=ZZ,Y.zipObject=QZ,Y.zipObjectDeep=JZ,Y.zipWith=eQ,Y.entries=KP,Y.entriesIn=GP,Y.extend=UP,Y.extendWith=Uf,Zm(Y,Y),Y.add=Zee,Y.attempt=JP,Y.camelCase=tee,Y.capitalize=XP,Y.ceil=Qee,Y.clamp=QJ,Y.clone=YQ,Y.cloneDeep=KQ,Y.cloneDeepWith=GQ,Y.cloneWith=qQ,Y.conformsTo=XQ,Y.deburr=ZP,Y.defaultTo=Ree,Y.divide=Jee,Y.endsWith=nee,Y.eq=Ea,Y.escape=ree,Y.escapeRegExp=aee,Y.every=fQ,Y.find=vQ,Y.findIndex=wP,Y.findKey=PJ,Y.findLast=pQ,Y.findLastIndex=_P,Y.findLastKey=OJ,Y.floor=ete,Y.forEach=MP,Y.forEachRight=RP,Y.forIn=NJ,Y.forInRight=MJ,Y.forOwn=RJ,Y.forOwnRight=TJ,Y.get=Ym,Y.gt=ZQ,Y.gte=QQ,Y.has=DJ,Y.hasIn=qm,Y.head=SP,Y.identity=Or,Y.includes=CQ,Y.indexOf=pZ,Y.inRange=JJ,Y.invoke=LJ,Y.isArguments=to,Y.isArray=zt,Y.isArrayBuffer=JQ,Y.isArrayLike=Sr,Y.isArrayLikeObject=An,Y.isBoolean=eJ,Y.isBuffer=Ci,Y.isDate=tJ,Y.isElement=nJ,Y.isEmpty=rJ,Y.isEqual=aJ,Y.isEqualWith=iJ,Y.isError=Bm,Y.isFinite=oJ,Y.isFunction=Qa,Y.isInteger=FP,Y.isLength=Hf,Y.isMap=VP,Y.isMatch=lJ,Y.isMatchWith=uJ,Y.isNaN=sJ,Y.isNative=cJ,Y.isNil=dJ,Y.isNull=fJ,Y.isNumber=zP,Y.isObject=Mn,Y.isObjectLike=Tn,Y.isPlainObject=Su,Y.isRegExp=Um,Y.isSafeInteger=vJ,Y.isSet=WP,Y.isString=Bf,Y.isSymbol=jr,Y.isTypedArray=tl,Y.isUndefined=pJ,Y.isWeakMap=hJ,Y.isWeakSet=mJ,Y.join=CZ,Y.kebabCase=iee,Y.last=oa,Y.lastIndexOf=bZ,Y.lowerCase=oee,Y.lowerFirst=lee,Y.lt=gJ,Y.lte=yJ,Y.max=tte,Y.maxBy=nte,Y.mean=rte,Y.meanBy=ate,Y.min=ite,Y.minBy=ote,Y.stubArray=Jm,Y.stubFalse=eg,Y.stubObject=Uee,Y.stubString=Yee,Y.stubTrue=qee,Y.multiply=lte,Y.nth=xZ,Y.noConflict=Lee,Y.noop=Qm,Y.now=zf,Y.pad=uee,Y.padEnd=see,Y.padStart=cee,Y.parseInt=fee,Y.random=eee,Y.reduce=EQ,Y.reduceRight=SQ,Y.repeat=dee,Y.replace=vee,Y.result=BJ,Y.round=ute,Y.runInContext=ue,Y.sample=OQ,Y.size=RQ,Y.snakeCase=pee,Y.some=TQ,Y.sortedIndex=NZ,Y.sortedIndexBy=MZ,Y.sortedIndexOf=RZ,Y.sortedLastIndex=TZ,Y.sortedLastIndexBy=kZ,Y.sortedLastIndexOf=IZ,Y.startCase=mee,Y.startsWith=gee,Y.subtract=ste,Y.sum=cte,Y.sumBy=fte,Y.template=yee,Y.times=Kee,Y.toFinite=Ja,Y.toInteger=Wt,Y.toLength=HP,Y.toLower=Cee,Y.toNumber=la,Y.toSafeInteger=CJ,Y.toString=fn,Y.toUpper=bee,Y.trim=xee,Y.trimEnd=wee,Y.trimStart=_ee,Y.truncate=Eee,Y.unescape=See,Y.uniqueId=Xee,Y.upperCase=Pee,Y.upperFirst=Km,Y.each=MP,Y.eachRight=RP,Y.first=SP,Zm(Y,function(){var i={};return Da(Y,function(u,h){pn.call(Y.prototype,h)||(i[h]=u)}),i}(),{chain:!1}),Y.VERSION=r,_r(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){Y[i].placeholder=Y}),_r(["drop","take"],function(i,u){Qt.prototype[i]=function(h){h=h===n?1:Bn(Wt(h),0);var w=this.__filtered__&&!u?new Qt(this):this.clone();return w.__filtered__?w.__takeCount__=ur(h,w.__takeCount__):w.__views__.push({size:ur(h,z),type:i+(w.__dir__<0?"Right":"")}),w},Qt.prototype[i+"Right"]=function(h){return this.reverse()[i](h).reverse()}}),_r(["filter","map","takeWhile"],function(i,u){var h=u+1,w=h==F||h==D;Qt.prototype[i]=function(I){var q=this.clone();return q.__iteratees__.push({iteratee:Pt(I,3),type:h}),q.__filtered__=q.__filtered__||w,q}}),_r(["head","last"],function(i,u){var h="take"+(u?"Right":"");Qt.prototype[i]=function(){return this[h](1).value()[0]}}),_r(["initial","tail"],function(i,u){var h="drop"+(u?"":"Right");Qt.prototype[i]=function(){return this.__filtered__?new Qt(this):this[h](1)}}),Qt.prototype.compact=function(){return this.filter(Or)},Qt.prototype.find=function(i){return this.filter(i).head()},Qt.prototype.findLast=function(i){return this.reverse().find(i)},Qt.prototype.invokeMap=Yt(function(i,u){return typeof i=="function"?new Qt(this):this.map(function(h){return Cu(h,i,u)})}),Qt.prototype.reject=function(i){return this.filter(jf(Pt(i)))},Qt.prototype.slice=function(i,u){i=Wt(i);var h=this;return h.__filtered__&&(i>0||u<0)?new Qt(h):(i<0?h=h.takeRight(-i):i&&(h=h.drop(i)),u!==n&&(u=Wt(u),h=u<0?h.dropRight(-u):h.take(u-i)),h)},Qt.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Qt.prototype.toArray=function(){return this.take(z)},Da(Qt.prototype,function(i,u){var h=/^(?:filter|find|map|reject)|While$/.test(u),w=/^(?:head|last)$/.test(u),I=Y[w?"take"+(u=="last"?"Right":""):u],q=w||/^find/.test(u);I&&(Y.prototype[u]=function(){var J=this.__wrapped__,ae=w?[1]:arguments,ce=J instanceof Qt,Se=ae[0],Pe=ce||zt(J),Me=function(Gt){var tn=I.apply(Y,Jr([Gt],ae));return w&&Ke?tn[0]:tn};Pe&&h&&typeof Se=="function"&&Se.length!=1&&(ce=Pe=!1);var Ke=this.__chain__,dt=!!this.__actions__.length,Nt=q&&!Ke,Bt=ce&&!dt;if(!q&&Pe){J=Bt?J:new Qt(this);var Mt=i.apply(J,ae);return Mt.__actions__.push({func:Ff,args:[Me],thisArg:n}),new ra(Mt,Ke)}return Nt&&Bt?i.apply(this,ae):(Mt=this.thru(Me),Nt?w?Mt.value()[0]:Mt.value():Mt)})}),_r(["pop","push","shift","sort","splice","unshift"],function(i){var u=cf[i],h=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",w=/^(?:pop|shift)$/.test(i);Y.prototype[i]=function(){var I=arguments;if(w&&!this.__chain__){var q=this.value();return u.apply(zt(q)?q:[],I)}return this[h](function(J){return u.apply(zt(J)?J:[],I)})}}),Da(Qt.prototype,function(i,u){var h=Y[u];if(h){var w=h.name+"";pn.call(Xo,w)||(Xo[w]=[]),Xo[w].push({name:u,func:h})}}),Xo[Tf(n,x).name]=[{name:"wrapper",func:n}],Qt.prototype.clone=SG,Qt.prototype.reverse=PG,Qt.prototype.value=OG,Y.prototype.at=nQ,Y.prototype.chain=rQ,Y.prototype.commit=aQ,Y.prototype.next=iQ,Y.prototype.plant=lQ,Y.prototype.reverse=uQ,Y.prototype.toJSON=Y.prototype.valueOf=Y.prototype.value=sQ,Y.prototype.first=Y.prototype.head,du&&(Y.prototype[du]=oQ),Y},qo=aG();Ia?((Ia.exports=qo)._=qo,jo._=qo):jn._=qo}).call(Fn)}(Hc,Hc.exports);var FK=Hc.exports;const Uh=Gn(FK),{Title:VK}=x9,{Option:zK}=jb,nu={keywords:[],matchType:"all"},WK={date:mU,string:LK,boolean:zB,daterange:IK,select:o2,keywords:e=>{var k,U,V;const{field:t,value:n,onChange:r}=e,{inputProps:{loadOptions:a,i18n:o}={}}=t.input||{},[l,s]=W.useState(!1),[c,f]=W.useState(n||nu),[p,v]=W.useState(""),m=lN(p,{wait:200}),[g,C]=W.useState([]),[b,y]=W.useState(!1);W.useEffect(()=>{R()},[l]),W.useEffect(()=>{n||f(nu)},[n]),W.useEffect(()=>{m!==""&&m!==void 0&&typeof a=="function"&&(y(!0),a({keywords:[...(c==null?void 0:c.keywords)||[],m],matchType:(c==null?void 0:c.matchType)||"all"}).then(B=>{y(!1),C(B)}))},[m]);const x=[{key:"0",label:(o==null?void 0:o.allText)||"all",onClick:()=>f({...c,matchType:"all"})},{key:"1",label:(o==null?void 0:o.anyText)||"any",onClick:()=>f({...c,matchType:"any"})}],_=B=>{var F;const H=new RegExp(`\\b(${(F=(c==null?void 0:c.keywords)||[])==null?void 0:F.join("|")})\\b`,"gi"),L=B.split(H);return Ye.jsx(W.Fragment,{children:L.map((j,D)=>H.test(j)?Ye.jsx("b",{children:j},D):Ye.jsx("span",{children:j},D))})},E=()=>{f(nu),v(""),C([]),y(!1),r({[t.name]:{keywords:[],matchType:"all"}})},R=()=>{f(n||nu),v(""),C([]),y(!1)},S=B=>B==null?void 0:B.filter(H=>{var L;return!((L=c==null?void 0:c.keywords)!=null&&L.includes(H))}),P=()=>(c==null?void 0:c.matchType)==="all"?(o==null?void 0:o.allText)||"all":(o==null?void 0:o.anyText)||"any",O=Ye.jsxs("div",{className:"wand__inline-filter__keywords__popover-content",children:[Ye.jsx(VK,{level:5,children:t==null?void 0:t.label}),Ye.jsxs("div",{className:"wand__inline-filter__match-type",children:[Ye.jsx("div",{children:(o==null?void 0:o.matchText)||"Matches"}),Ye.jsx(V1,{menu:{items:x},trigger:["click"],children:Ye.jsx("a",{onClick:B=>B.preventDefault(),children:Ye.jsxs("span",{children:[P()," ",Ye.jsx(Lb,{style:{fontSize:"12px"}})]})})}),Ye.jsx("div",{children:(o==null?void 0:o.keywordsText)||"of theses keywords :"})]}),Ye.jsx("div",{className:"wand__inline-filter__keywords__popover__keyword-list",children:(k=c==null?void 0:c.keywords)==null?void 0:k.map((B,H)=>Ye.jsxs("div",{className:"wand__inline-filter__keywords__popover__keyword",children:[Ye.jsx("div",{children:B}),Ye.jsx(K6,{onClick:()=>{var L;return f({...c,keywords:(L=c==null?void 0:c.keywords)==null?void 0:L.filter((F,j)=>j!==H)})}})]},H))}),Ye.jsx(jb,{className:"wand__inline-filter__search-input",showSearch:!0,placeholder:"Add a keyword",loading:b,onSearch:B=>{v(B||"")},onChange:B=>{v(""),C([]),f({...c,keywords:[...(c==null?void 0:c.keywords)||[],B]})},style:{width:"100%",marginBottom:10},value:p,children:S(g||[]).map((B,H)=>Ye.jsx(zK,{value:B,children:_(B)},H))}),Ye.jsxs("div",{className:"wand__inline-filter__keywords__popover-footer",children:[Ye.jsx("div",{children:Ye.jsx("a",{onClick:E,children:(o==null?void 0:o.clearText)||"Clear"})}),Ye.jsxs("div",{className:"wand__inline-filter__keywords__popover-footer-right",children:[Ye.jsx(za,{type:"link",onClick:()=>{f(n||nu),s(!1)},children:(o==null?void 0:o.cancelText)||"Cancel"}),Ye.jsx(za,{type:"primary",onClick:()=>{r({[t.name]:c}),s(!1)},disabled:Uh.isEqual(Uh.sortBy(n),Uh.sortBy(c)),children:(o==null?void 0:o.searchText)||"Search"})]})]})]});return Ye.jsx("div",{className:"wand__inline-filter__keywords",children:Ye.jsx(Wv,{showArrow:!1,open:l,content:O,placement:"bottom",onOpenChange:s,trigger:"click",overlayClassName:"wand__inline-filter__popover",overlayStyle:{width:"500px"},children:Ye.jsx("div",{className:"wand__inline-filter__filter",children:Ye.jsxs(ga,{children:[Ye.jsx("span",{className:"wand__inline-filter__label",children:t.label}),c!=null&&c.keywords&&((U=c==null?void 0:c.keywords)==null?void 0:U.length)>0?Ye.jsx(Jb,{className:"wand__inline-filter__badge",count:(V=c==null?void 0:c.keywords)==null?void 0:V.length}):t.icon]})})})})}};return e=>{const{schema:t,value:n=void 0,defaultValue:r={},debug:a=!1,delay:o=200,resetText:l,toggle:s,onReset:c}=e,[f,p]=Qk(s!=null&&s.key?`${s==null?void 0:s.key}-filters`:"filter-toggle"),[v,m]=W.useState(n||r);W.useEffect(()=>{n&&m(n)},[n]);const g=()=>{c&&(n||m({}),c())},{run:C}=hg(E=>{e.onChange&&e.onChange(E)},{wait:o}),b=E=>{m(E),C(E)},y=E=>b(mw({...v,...E},s?f:[])),x=E=>{p(E),b(mw({...v},s?E:[]))};let _=t;return s&&f&&f.length>0&&(_=_.filter(E=>E.toggleable!==void 0&&!E.toggleable||!f.includes(Array.isArray(E.name)?E.name.join("//="):E.name))),Ye.jsxs(ga,{style:{width:"100%"},wrap:!0,children:[_.map(E=>{const R=WK[E.input.type]||o2;return Ye.jsx(R,{field:E,value:Array.isArray(E.name)?E.name.reduce((S,P)=>(S[P]=v[P],S),{}):v[E.name],onChange:y},Array.isArray(E.name)?E.name.join("--"):E.name)}),s&&Ye.jsx(VB,{schema:t,value:f,onChange:x,...s||{}}),c&&Ye.jsx(za,{type:"text",onClick:g,children:l||"Reset filters"})]})}});
|