PageSourceSearch

https://destinasian.co.id/_next/static/chunks/393.24ff5f6c252f99f5.js

js destinasian.co.id collected 2026-10-02 18:15:41 UTC 6,255 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[393],{80393:function(e,a,s){"use strict";s.r(a),s.d(a,{default:function(){return T}});var n=s(85893),r=s(67294),t=s(44818),c=s(25675),l=s.n(c),i=s(41664),o=s.n(i),d=s(19845),u=s.n(d),h=s(61337),_=s(2914),p=s(19245),g=s.n(p),m=s(37340);function x(){let e=(0,m._)(["\n  query GetContentNodesSearch(\n    $search: String!\n    $first: Int = 30\n    $after: String\n  ) {\n    contentNodes(\n      where: {\n        search: $search\n        status: PUBLISH\n        contentTypes: [POST, TRAVEL_GUIDE]\n      }\n      first: $first\n      after: $after\n    ) {\n      pageInfo {\n        hasNextPage\n        endCursor\n      }\n      nodes {\n        __typename\n        id\n        uri\n        date\n\n        ... on NodeWithTitle {\n          title\n        }\n\n        ... on NodeWithExcerpt {\n          excerpt\n        }\n\n        ... on NodeWithFeaturedImage {\n          featuredImage {\n            node {\n              sourceUrl\n            }\n          }\n        }\n\n        ... on Post {\n          categories {\n            edges {\n              node {\n                name\n              }\n              isPrimary\n            }\n          }\n        }\n\n        ... on TravelGuide {\n          categories {\n            edges {\n              node {\n                name\n              }\n              isPrimary\n            }\n          }\n        }\n      }\n    }\n  }\n"]);return x=function(){return e},e}let f=(0,s(68806).Ps)(x());var v=s(82745),N=s(84377);let j=u().bind(g());function T(e){let{setIsSearchResultsVisible:a}=e,s=(0,r.useRef)(null),[c,i]=(0,r.useState)(""),[d,u]=(0,r.useState)("");(0,r.useEffect)(()=>{let e=setTimeout(()=>{u(c.trim())},400);return()=>clearTimeout(e)},[c]);let p=d.length>=2,{data:g,error:m,loading:x}=(0,t.aM)(f,{variables:{search:d,first:300,after:null},skip:!p,fetchPolicy:"cache-first",nextFetchPolicy:"cache-first"}),T=(0,r.useMemo)(()=>{var e;if(!(null==g?void 0:null===(e=g.contentNodes)||void 0===e?void 0:e.nodes))return[];let a=new Set;return g.contentNodes.nodes.reduce((e,s)=>{var n,r,t,c,l,i,o,d,u,h;if(!(null==s?void 0:s.id)||a.has(s.id)||"Post"!==s.__typename&&"TravelGuide"!==s.__typename)return e;a.add(s.id);let _=(null===(c=s.categories)||void 0===c?void 0:null===(t=c.edges)||void 0===t?void 0:null===(r=t.find(e=>e.isPrimary))||void 0===r?void 0:null===(n=r.node)||void 0===n?void 0:n.name)||(null===(d=s.categories)||void 0===d?void 0:null===(o=d.edges)||void 0===o?void 0:null===(i=o[0])||void 0===i?void 0:null===(l=i.node)||void 0===l?void 0:l.name)||"";return e.push({id:s.id,uri:s.uri,title:s.title,excerpt:s.excerpt,date:s.date,featuredImage:null===(h=s.featuredImage)||void 0===h?void 0:null===(u=h.node)||void 0===u?void 0:u.sourceUrl,category:_}),e},[])},[g]);(0,r.useEffect)(()=>{a&&a(c.length>0||T.length>0)},[c.length,T.length,a]);let S=(0,r.useCallback)(()=>{var e;i(""),null===(e=s.current)||void 0===e||e.focus()},[]),w=(0,r.useCallback)(e=>{if(!e)return"";let a=e.replace(/<[^>]+>/g,"").replace(/\[\/?dropcap\]/g,"").slice(0,110),s=a.lastIndexOf(" ");return s>0&&(a=a.slice(0,s)),"".concat(a,"...")},[]);return(0,n.jsxs)("div",{className:j("component"),children:[(0,n.jsxs)("div",{className:j("search-wrapper","fixed-search"),children:[(0,n.jsx)(h.uFR,{className:j("search-icon")}),(0,n.jsx)("input",{ref:s,type:"text",placeholder:"Enter your search…",className:j("search-input"),value:c,onChange:e=>i(e.target.value)}),c.length>0&&(0,n.jsx)("button",{type:"button",onClick:S,className:j("search-close"),"aria-label":"Clear search",children:"\xd7"})]}),(c.length>0||T.length>0)&&(0,n.jsxs)("div",{className:j("results-scroll"),children:[m&&(0,n.jsxs)("div",{className:j("no-results"),children:["Error: ",m.message]}),!p&&c.length>0&&(0,n.jsxs)("div",{className:j("no-results"),children:[(0,n.jsx)(h.uFR,{className:j("no-results-icon")}),(0,n.jsxs)("span",{className:j("no-results-text"),children:["Type at least ",2," characters…"]})]}),p&&x&&(0,n.jsx)("div",{className:"mx-auto flex h-[40vh] items-center justify-center",children:(0,n.jsx)(_.fCD,{className:"h-8 w-8 animate-spin text-black"})}),p&&!x&&0===T.length&&(0,n.jsxs)("div",{className:j("no-results"),children:[(0,n.jsx)(h.uFR,{className:j("no-results-icon")}),(0,n.jsx)("span",{className:j("no-results-text"),children:"No results found."})]}),T.map(e=>(0,n.jsxs)("div",{className:j("content-wrapper"),children:[e.featuredImage&&(0,n.jsx)(o(),{href:(0,N.m)(e.uri),className:j("image-link"),children:(0,n.jsx)("div",{className:j("image-wrapper"),children:(0,n.jsx)(l(),{quality:75,src:e.featuredImage,alt:e.title||"",width:300,height:225,sizes:"(max-width: 768px) 40vw, 300px",style:{objectFit:"cover"}})})}),(0,n.jsxs)("div",{className:j("right-wrapper"),children:[e.category&&e.date&&(0,n.jsxs)("div",{className:j("meta-date"),children:[(0,n.jsx)("span",{className:j("meta"),children:e.category}),(0,n.jsx)("span",{className:j("meta"),children:" | "}),(0,n.jsx)(v.Z,{date:e.date,className:j("meta")})]}),(0,n.jsx)("h2",{className:j("title","truncate"),children:(0,n.jsx)(o(),{href:(0,N.m)(e.uri),children:e.title})}),e.excerpt&&(0,n.jsx)("div",{className:j("excerpt"),children:w(e.excerpt)})]})]},e.id))]})]})}},19245:function(e){e.exports={component:"SearchTags_component__jmBxp","fixed-search":"SearchTags_fixed-search__A6LWF","results-scroll":"SearchTags_results-scroll__KecLq","content-wrapper":"SearchTags_content-wrapper__2sDWd","left-wrapper":"SearchTags_left-wrapper__ABjyS","right-wrapper":"SearchTags_right-wrapper__1Fjm2","image-wrapper":"SearchTags_image-wrapper__0IQPX","meta-date":"SearchTags_meta-date__8_8_X",meta:"SearchTags_meta__3EtWo","tags-row":"SearchTags_tags-row__zY3Iu",tag:"SearchTags_tag__Wf3Lb",title:"SearchTags_title__uwUCx",truncate:"SearchTags_truncate__FGEth",excerpt:"SearchTags_excerpt__hpMgO","no-results":"SearchTags_n
1o-results__a_eiP","no-results-row":"SearchTags_no-results-row__cy8kZ","no-results-icon":"SearchTags_no-results-icon__dZePr","no-results-text":"SearchTags_no-results-text__wun2C","search-wrapper":"SearchTags_search-wrapper__9DMgl","search-icon":"SearchTags_search-icon__BYHZm","search-close":"SearchTags_search-close__zyeMT","search-input":"SearchTags_search-input__59sgj"}}}]);

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.