1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="d5b20385-7160-42cf-90e5-502ca26e2851",e._sentryDebugIdIdentifier="sentry-dbid-d5b20385-7160-42cf-90e5-502ca26e2851")}catch(e){}}();import"./_sentry-release-injection-file-SYOkQ1Km.js";import{a as e}from"./rolldown-runtime-BBzOAo5_.js";import{t as s}from"./react-DuV36FPs.js";import{s as t}from"./_baseUnset-D3G1PSyW.js";import{t as r}from"./_createAggregator-clsN04mB.js";import{t as n}from"./isEmpty-BteR97MS.js";import{t as o}from"./prop-types-Ccm1EFGL.js";import{t as a}from"./Popover-SQcXFpwc.js";import{t as l}from"./isEmptyValue-D-Y8qpKB.js";import{K as i,at as c,ut as d}from"./index-CRc22cjs.js";import{t as u}from"./FormLayoutContext-CsyD3FrV.js";import{t as g}from"./Checkbox-BhDCB8Uo.js";import{t as m}from"./usePageLayout-CkXFEI4G.js";import{t as p}from"./IconExternal-DXzX9anb.js";import{l as h,n as j,o as x}from"./FinalControlGroup-Cmc21xKd.js";import{t as f}from"./RadioButton-BXZiWCQs.js";var b=r((function(e,s,r){t(e,r,s)})),S=e(s()),C=c(),y=e(o()),v=i(),k=({aggregators:e,harvestCount:s,useModal:t=!1,name:r="exclude_aggregators",t:o})=>{const a=h(r),i=l(a.input.value)?null:a.input.value,c=(0,S.useMemo)((()=>b(e,"id")),[e]),u=(0,S.useMemo)((()=>i?d(c,((e,s)=>!i.includes(s))):c),[c,i]),[m,x]=(0,S.useState)((()=>!!(i&&i.length>0)&&!n(u))),f=(0,S.useCallback)((e=>{const s=e.target.value,t=!u[s],r=i||[];t?a.input.onChange(r.filter((e=>e!==s))):a.input.onChange([...r,s])}),[u,i,a.input]),C=i&&i.length<=e.length,y=(0,v.jsx)("div",{children:(0,v.jsx)("a",{href:"#!",onClick:s=>{s.preventDefault(),a.input.onChange(C?[]:e.map((e=>e.id)))},className:"small",children:o(C?"Select all":"Clear all")})}),k={renderProps:a,siteCheckboxes:e.map((e=>(0,v.jsx)("div",{children:(0,v.jsxs)(g,{name:r+"[]",value:e.id,checked:!!u[e.id],disabled:j(a.meta),onChange:f,children:[e.name,"DD"===e.id&&" ("+s+")",e.url&&(0,v.jsx)("a",{href:e.url,rel:"noreferrer",target:"_blank",children:(0,v.jsx)(p,{})})]})},e.id))),toggleButton:y,selectingSites:m,setSelectingSites:x};return t?(0,v.jsx)(D,{...k,checkedAggregatorsById:u,harvestCount:s}):(0,v.jsx)(P,{...k})};(k=(0,C.withTranslators)(k)).propTypes={aggregators:y.array.isRequired,harvestCount:y.number.isRequired,name:y.string,useModal:y.bool};var w=k,T=({renderProps:e,selectingSites:s,setSelectingSites:t,extraStuffForSelectionLabel:r=null,onSelection:n})=>{const o=(0,S.useContext)(u).inputs||{},a=(0,S.useContext)(u).groups||{},l=j(e.meta);return(0,v.jsxs)("div",{className:"radio-group"+(o.small||a.vertical?" padding-top--none":""),children:[(0,v.jsx)(f,{label:(0,v.jsx)(C.T,{message:"All sites"}),onChange:()=>{t(!1),e.input.onChange([])},checked:!s,disabled:l,large:!o.small}),(0,v.jsx)(f,{label:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(C.T,{message:"Select sites"}),s&&r]}),onChange:()=>{t(!0),n&&n()},checked:s,disabled:l,large:!o.small})]})},D=({renderProps:e,checkedAggregatorsById:s,selectingSites:t,setSelectingSites:r,toggleButton:n,siteCheckboxes:o,harvestCount:l})=>{const i=(0,S.useRef)(null),[c,d]=(0,S.useState)(!1),u=!!s.DD,g=Object.keys(s).length,m=(0,v.jsxs)(v.Fragment,{children:[" ","(",u?g-1+l:g,")",(0,v.jsx)("button",{className:"button button--really-small margin-left--half",onClick:()=>d(!0),ref:i,type:"button",children:(0,v.jsx)(C.T,{message:"Edit selection"})})]});return(0,v.jsxs)(x,{label:(0,v.jsx)(C.T,{message:"Sites to search:"}),children:[(0,v.jsx)(T,{renderProps:e,selectingSites:t,setSelectingSites:r,useModal:!0,extraStuffForSelectionLabel:m,onSelection:()=>d(!0)}),c&&(0,v.jsxs)(a,{parentRef:i,onHide:()=>d(!1),children:[n,(0,v.jsx)("div",{className:"checkbox-group checkbox-group--three-columns",children:o}),(0,v.jsx)("div",{className:"margin-top--half center",children:(0,v.jsx)("a",{className:"button button--small",onClick:()=>d(!1),children:(0,v.jsx)(C.T,{message:"Close window"})})})]})]})},P=({renderProps:e,selectingSites:s,setSelectingSites:t,toggleButton:r,siteCheckboxes:n})=>{const{columnCount:o}=m(),a=(0,S.useContext)(u).groups||{},l=o>2&&!a.vertical;return(0,v.jsxs)(x,{label:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(C.T,{message:"Sites to search:"}),s&&l&&r]}),children:[(0,v.jsx)(T,{renderProps:e,selectingSites:s,setSelectingSites:t,useModal:!1}),s&&!l&&r,s&&(0,v.jsx)("div",{className:"checkbox-group checkbox-group--two-columns"+(a.vertical?" padding-top--none":""),children:n})]})};export{w as t}; 2//# sourceMappingURL=SearchSources-DzUyx6OD.js.map
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.