PageSourceSearch

https://canalrivertrust.org.uk/build/215.abc7b632.js

js canalrivertrust.org.uk collected 2026-09-24 08:43:54 UTC 9,427 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[215,392],{215:function(e,t,o){o.d(t,{default:function(){return E}});var r=o(8711),n=o(1575),a=o(96540),i=o(49785),l=o(60134),d=o(15941),s=o(80191),u=o(52300),m=o(50392),c=o(34717),p=o(5922),h=o(98224),g=o(47474),b=o(60841),f=o(46821),w=o(60721);const v=r.Ay.div.withConfig({displayName:"DocumentLibrary__StyledContainer",componentId:"sc-18g6cp-0"})((()=>[{"& h2":{marginTop:"0px",borderBottomWidth:"1px",borderColor:"var(--brand-towpath-500)",paddingBottom:"0.5rem","@media (min-width: 1180px)":{marginBottom:"1.5rem"}},"& form":{"& button[type='submit']":{width:"100%",marginTop:"1.5rem",maxWidth:"24rem",marginBottom:"1rem"},"& label":{marginTop:"1rem","@media (min-width: 1180px)":{marginTop:"0px"},fontWeight:"700",marginBottom:"0px"},"& .dropdown__list > ul":{height:"24rem",overflow:"auto"}}}])),x=(0,d.Ik)({keywords:(0,d.Yj)().trim().transform(((e,t)=>""===t?null:e)).nullable(),option:(0,d.Yj)().trim().transform(((e,t)=>""===t?null:e)).nullable()}),y="Find Documents";function _(e){let{tags:t,preFilterTags:o=[],title:r=y}=e;const l=(0,a.useMemo)((()=>null==t?void 0:t.map((e=>({label:e,value:e})))),[t]),[d,_]=(0,a.useState)(null),E=(0,a.useCallback)((e=>{e.tags=e.tags||[],e.tags=e.tags.concat(o),_(e)}),[]),{data:k,isFetching:W,isError:R}=(0,u.VD)(d,{refetchOnMountOrArgChange:!0,skip:!d}),C=(0,i.mN)({resolver:(0,n.t)(x),defaultValues:{keywords:"",option:""}});(0,m.t)(C,t,E);const B=(0,a.useMemo)((()=>{const e=(null==k?void 0:k.features)??[];return Array.isArray(e)?e.map((e=>e.properties)):[]}),[k]);return(0,s.oT)(d??{}),a.createElement(i.Op,C,a.createElement(v,{"data-testid":"documentLibraryComponent"},a.createElement("h2",null,r??y),a.createElement("form",{onSubmit:C.handleSubmit((e=>{const t=[];"Any"!==e.option&&t.push(e.option),E({keywords:e.keywords,tags:t})})),noValidate:!0},a.createElement(g.A,null,a.createElement(f.A,{label:"Search",name:"keywords",optional:!0,placeholder:"keywords",variant:b.iW})),a.createElement(g.A,null,a.createElement(w.A,{defaultValue:"Any",disabled:W,label:"Subject Area",name:"option",selectOptions:l,variant:b.iW})),a.createElement(c.Ay,{type:"submit",isDisabled:W,isFetching:W,isIcon:!0},"Search")),a.createElement(a.Fragment,null,Boolean(W)&&a.createElement("p",null,"Loading..."),Boolean(R)&&a.createElement(h.A,{error:"There was a problem fetching the documents"}),Boolean(!W)&&0===B.length&&a.createElement("p",null,"No documents found"),Boolean(!W)&&B.length>0&&a.createElement(p.A,{listings:B}))))}function E(e){const t=window.ReactOnRails.getStore("store");return a.createElement(l.Provider,{store:t},a.createElement(_,e))}},50392:function(e,t,o){o.d(t,{t:function(){return n}});var r=o(96540);function n(e,t,o){return(0,r.useEffect)((()=>{const r=new URLSearchParams(window.location.search);let n="",a=[];r.get("keywords")&&(n=r.get("keywords"),e.setValue("keywords",n)),r.get("tags")&&t.includes(r.get("tags"))&&(a=[r.get("tags")],e.setValue("option",a[0])),o({keywords:n,tags:a})}),[e,t,o]),null}},60721:function(e,t,o){o.d(t,{A:function(){return g}});var r=o(8711),n=o(15685),a=o(20982),i=o(92756),l=o(20053),d=o(96540),s=o(49785),u=o(95997),m=o(60841);function c(){return c=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},c.apply(this,arguments)}const p={[m.GF]:{"& button[type='button']":{backgroundColor:"var(--brand-white-500)"},"& .dropdown__list > ul":{backgroundColor:"var(--brand-white-500)"}},[m.iW]:{"& button[type='button']":{borderRadius:"0.5rem",borderWidth:"1px",borderColor:"var(--brand-towpath-500)",color:"var(--brand-darkslate-500)",backgroundColor:"var(--brand-white-500)",paddingLeft:"1rem",paddingRight:"1rem",height:"auto","@media (min-width: 1024px)":{width:"auto"}},"& button[data-headlessui-state='open']":{borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",borderBottomColor:"transparent",position:"relative",":after":{content:"var(--tw-content)","--tw-content":"''",position:"absolute",bottom:"0px",left:"1rem",right:"1rem",borderColor:"var(--brand-towpath-500)",borderBottomWidth:"1px"}},"&& .dropdown__list > ul":{backgroundColor:"var(--brand-white-500)",borderBottomWidth:"1px",borderLeftWidth:"1px",borderRightWidth:"1px",borderColor:"var(--brand-towpath-500)",height:"fit-content",maxHeight:"24rem","@media (min-width: 1024px)":{width:"auto"},"& > li":{marginLeft:"1rem",marginRight:"1rem","& .listbox__option__active":{borderWidth:"1px",borderColor:"var(--brand-towpath-500)"}}},"& ul[data-headlessui-state='open']":{borderBottomLeftRadius:"0.5rem",borderBottomRightRadius:"0.5rem"},"& .selected":{color:"var(--brand-darkslate-500)"}}},h=r.Ay.div.withConfig({displayName:"Select__StyledContainer",componentId:"sc-132fum2-0"})((e=>{let{errorMessage:t,fullWidth:o,variant:r,label:n}=e;return[{display:"grid",gap:"0.5rem","& .input__optional":{fontWeight:"100"},"& button[type='button']":{height:"3rem",paddingLeft:"1.5rem",paddingRight:"1.5rem",paddingTop:"0.5rem",paddingBottom:"0.5rem",lineHeight:"2",borderRadius:"9999px",backgroundColor:"var(--brand-towpath-200)",display:"flex",alignItems:"center",justifyContent:"space-between","@media (min-width: 1024px)":{width:"40%"}},"& button[data-headlessui-state='open']":{borderTopLeftRadius:"1rem",borderTopRightRadius:"1rem",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",color:"var(--brand-darkslate-500)"},"& ul[data-headlessui-state='open']":{borderBottomLeftRadius:"1rem",borderBottomRightRadius:"1rem","@media (min-width: 1024px)":{width:"40%"}},"& .dropdown__icons":{display:"flex",flexDirection:"column",color:"var(--brand-darkslate-500)"},"& .dropdown__list":{position:"relative",zIndex:"41","& > ul":{margin:"0px",padding:"0px",backgroundColor:"var(--brand-towpath-200)",position:"absolute",top:"-0.5rem",right:"0px",left:"0px",zIndex:"20",maxHeight:"24rem",overflow:"auto","& > li":{marginLeft:"1.5rem",marginRight:"1.5rem",color:"var(--brand-towpath-700)",paddingTop:"0.5rem",paddingBottom:"0.5rem",marginTop:"0px",marginBottom:"0px",paddingLeft:"0px",paddingRight:"0px",fontSize:".875rem"},"& > li:first-child":{marginTop:"0.5rem"},"& > li:last-child":{marginBottom:"1rem"},"& > li:hover":{cursor:"pointer",color:"var(--brand-darkslate-500)"}}},"@media (min-width: 1180px)":{rowGap:"0px"}},p[r],o&&{"& button[type='button']":{width:"100%"},"& ul[data-headlessui-state='open']":{width:"100%"}},n&&{fontWeight:"700","& .dropdown__list":{"@media (min-width: 1180px)":{gridColumnStart:"2"}}},t&&{"& div[role='alert']":{fontSize:".75rem",color:"var(--er)"},"& button[type='button']":{borderWidth:"1px",borderColor:"var(--er)"},"& button[data-headlessui-state='open']":{borderBottomWidth:"0px"},"& ul[data-headlessui-state='open']":{borderLeftWidth:"1px",borderRightWidth:"1px",borderBottomWidth:"1px",borderColor:"var(--er)"}}]}));function g(e){let{defaultValue:t="Please select",disabled:o=!1,fullWidth:r=!1,label:p=null,name:g,optional:b=!1,selectOptions:f,variant:w=null,testId:v=null}=e;const{control:x}=(0,s.xW)(),{field:{value:y,onChange:_},fieldState:{error:E}}=(0,s.as)({name:g,control:x}),k=null==E?void 0:E.message,{errorMessageProps:W}=(0,u._)({errorMessage:k,label:p}),R=(0,d.useMemo)((()=>function(e,t,o){var r;return e?null===(r=t.find((t=>t.value===e)))||void 0===r?void 0:r.label:o}(y,f,t)),[y,f,t]);return d.createElement(h,{errorMessage:k,variant:w,fullWidth:r,label:p,as:p?"label":"div"},p&&d.createElement("span",null,p," ",b&&d.createElement("span",{className:"input__optional"},"(optional)")),d.createElement(i.W,{disabled:o,name:g,onChange:_,value:y},d.createElement(i.W.Button,{className:"dropdown__button","data-testid":v},(()=>d.createElement(d.Fragment,null," ",d.createElement("span",{className:(0,l.A)(w!==m.iW?"input-hero":"select",y&&"selected")},R),d.createElement("span",{className:w!==m.iW?"input-hero dropdown__icons":"dropdown__icons select"},d.createElement(a.g,{icon:n.w2A}),d.createElement(a.g,{icon:n.Jt$}))))),d.createElement("div",{className:"dropdown__list"},d.createElement(i.W.Options,{onClick:e=>{e.preventDefault()}},f.map((e=>d.createElement(i.W.Option,{className:w!==m.iW?"input-hero":"select",key:e.value,value:e.value},(t=>{let{active:o}=t;return d.createElement("span",{className:o?"listbox__option__active":null},e.label)}))))))),k&&d.createElement("div",c({role:"alert"},W),k))}},80191:function(e,t,o){o.d(t,{T2:function(){return l},g4:function(){return i},oT:function(){return d},vJ:function(){return a}});var r=o(96540),n=o(94701);function a(e){return t=>{if(null!=t&&t.match(/^[\-\d\.]+,[\-\d\.]+$/)){const[o,r]=t.split(",").map((e=>Number.parseFloat(e)));e({lat:o,lng:r})}}}function i(e){return e?`${e.lat},${e.lng}`:null}function l(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,n.A)((()=>{const t=new URLSearchParams(window.location.search);for(const[o,r]of Object.entries(e))t.has(o)&&r(t.get(o))})),null}function d(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,r.useEffect)((()=>{const t=new URLSearchParams(window.location.search),o=t.toString();for(const[o,r]of Object.entries(e)){const e="function"==typeof r?r():r;null!=e&&0!==e.length&&""!==e?t.set(o,e):t.has(o)&&t.delete(o)}t.toString()!==o&&window.history.pushState({},"",`${window.location.origin}${window.location.pathname}?${t.toString()}`)}),[Object.values(e)]),null}}}]);

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.