PageSourceSearch

https://mot.go.th/_next/static/chunks/7766-1ca3cd7a5437960d.js

js mot.go.th collected 2026-10-02 10:00:43 UTC 7,743 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7766],{17766:function(e,t,n){n.r(t),n.d(t,{default:function(){return B}});var o=n(34051),r=n.n(o),i=n(85893),a=n(67294),l=n(18972),u=n(80822),c=n(98456),d=n(78462),s=n(25662),x=n(97212),f=n(48885),p=n(59334),v=n(15861),h=n(67720),m=n(11163),g=n(47464),y=n(62665),j=n(22961),b=n(99929),w=n(59870),S=n(9547),k=n(93877),C=n(9473),Z=n(80145),A=n(9669),E=n.n(A);n(53162);function z(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function I(e,t,n,o,r,i,a){try{var l=e[i](a),u=l.value}catch(c){return void n(c)}l.done?t(u):Promise.resolve(u).then(o,r)}function T(e){return function(){var t=this,n=arguments;return new Promise((function(o,r){var i=e.apply(t,n);function a(e){I(i,o,r,a,l,"next",e)}function l(e){I(i,o,r,a,l,"throw",e)}a(void 0)}))}}function R(e){return function(e){if(Array.isArray(e))return z(e)}(e)||function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"===typeof e)return z(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function B(e){var t,n,o,A,z=e.item,I=(0,m.useRouter)(),B=I.query.id,D=(0,C.v9)((function(e){return e.sizeFont.value})),P=(0,a.useState)([]),_=P[0],F=P[1],G=(0,a.useState)(!0),N=G[0],O=G[1],q=R(new Set(null===_||void 0===_||null===(t=_.data)||void 0===t?void 0:t.map((function(e){return null===e||void 0===e?void 0:e.Category})))),L=(0,a.useState)([]),M=L[0],W=L[1],$=[{title:"th"===I.locale?"\u0e17\u0e31\u0e49\u0e07\u0e2b\u0e21\u0e14":"all",value:""}].concat(R(new Set(null===M||void 0===M?void 0:M.map((function(e){return e}))))),H=(0,a.useState)({}),U=H[0],V=H[1],J=(0,a.useState)(""),K=J[0],Q=J[1],X=(0,a.useState)(!1),Y=X[0],ee=X[1],te=(0,a.useState)($[0].value),ne=te[0],oe=te[1],re=(0,a.useState)(!1),ie=re[0],ae=re[1],le=(0,a.useState)(!1),ue=le[0],ce=le[1],de=(0,a.useState)(""),se=de[0],xe=de[1];(0,a.useEffect)((function(){ie&&(E().get((0,k.p)("/document/".concat(se,"/action-view"))).then((function(e){return console.log(e)})),ae(!1)),ue&&(E().get((0,k.p)("/document/".concat(se,"/action-download"))).then((function(e){return console.log(e)})),ce(!1))}),[ie,ue,se]),(0,a.useEffect)((function(){var e=function(){var e=T(r().mark((function e(){var t,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,E().get((0,k.p)("/document/publish-year?id=".concat(B,"&locale=").concat(I.locale)));case 2:return t=e.sent,e.next=5,t.data;case 5:n=e.sent,W(n.map((function(e){return{title:+e+543,value:+e}})));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[B,I]),(0,a.useEffect)((function(){I.events.on("routeChangeComplete",(function(){V({title:"",year:""}),Q(""),oe(""),ee(!1)}))}),[]),(0,a.useEffect)((function(){var e=function(){var e=T(r().mark((function e(){var t,n;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,E().get((0,k.p)("/documents/?filters[department][id]=".concat(B,"&q=").concat((null===U||void 0===U?void 0:U.title)||"","&year=").concat((null===U||void 0===U?void 0:U.year)||"","&locale=").concat(I.locale)));case 2:return t=e.sent,e.next=5,t.data;case 5:n=e.sent,F(n),O(!1);case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e()}),[B,U,I]);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(Z.default,{title:"th"===I.locale?"\u0e04\u0e49\u0e19\u0e2b\u0e32\u0e40\u0e2d\u0e01\u0e2a\u0e32\u0e23/\u0e41\u0e1a\u0e1a\u0e1f\u0e2d\u0e23\u0e4c\u0e21\u0e14\u0e32\u0e27\u0e19\u0e4c\u0e42\u0e2b\u0e25\u0e14":"Search Document",backgroundColor:"background.default",children:[(0,i.jsx)(Z.GridText,{title:"th"===I.locale?"\u0e04\u0e33\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e04\u0e49\u0e19\u0e2b\u0e32":"Search Term",placeholder:"th"===I.locale?"\u0e23\u0e30\u0e1a\u0e38\u0e04\u0e33\u0e17\u0e35\u0e48\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e04\u0e49\u0e19\u0e2b\u0e32":"Enter the word you want to search.",value:K,onChange:Q}),(0,i.jsx)(Z.GridSelect,{title:"th"===I.locale?"\u0e1b\u0e35":"year",value:ne,onChange:oe,children:null===$||void 0===$?void 0:$.map((function(e){return(0,i.jsx)(l.Z,{value:e.value,children:e.title})}))}),(0,i.jsx)(Z.GridButton,{onClick:function(){V({title:K,year:ne}),O(!0),ee(!0)},text:"th"===I.locale?"\u0e04\u0e49\u0e19\u0e2b\u0e32":"Search"})]}),(0,i.jsx)(u.Z,{sx:{marginTop:"40px",marginBottom:"40px",height:"auto"},children:(0,i.jsxs)(u.Z,{sx:{backgroundColor:"background.default",borderRadius:"20px",padding:{lg:"20px 100px",md:"20px 100px",sm:"10px 20px",xs:"10px 0"}},children:[(0,i.jsx)(w.default,{textAlign:"center",children:null===z||void 0===z?void 0:z.title}),N?(0,i.jsx)(u.Z,{sx:{width:"100%",padding:"40px 0",display:"flex",justifyContent:"center"},children:(0,i.jsx)(c.Z,{size:60})}):(null===_||void 0===_||null===(n=_.data)||void 0===n?void 0:n.length)>0?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)(d.Z,{disablePadding:!0,sx:{display:Y?"block":"none",backgroundColor:"background.default",marginBottom:(null===_||void 0===_||null===(o=_.data)||void 0===o?void 0:o.length)>0?"50px":"0px"},children:[(0,i.jsx)(s.Z,{variant:"contained",onClick:function(){ee(!1),Q("");V({title:"",year:""}),oe($[0].value)},sx:{backgroundColor:"background.button",":hover":{backgroundColor:"background.buttonHover"}},children:"th"===I.locale?"\u0e25\u0e49\u0e32\u0e07\u0e01\u0e32\u0e23\u0e04\u0e49\u0e19\u0e2b\u0e32":"clear search"}),null===_||void 0===_||null===(A=_.data)||void 0===A?void 0:A.map((function(e,t){var n,o;return(0,i.jsxs)("div",{children:[(0,i.jsxs)(x.ZP,{sx:{justifyContent:"space-between"},children:[(0,i.jsxs)(u.Z,{sx:{display:"flex",alignItems:"center"},children:[(0,i.jsx)(f.Z,{children:(0,i.jsx)(y.Z,{sx:{color:"info.main",marginLeft:{lg:"10px",xs:"0px"}}})}),(0,i.jsxs)(u.Z,{sx:{width:"100%"},children:[(0,i.jsx)(p.Z,{primary:null===e||void 0===e?void 0:e.Title,sx:{color:"commons",display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:"4",overflow:"hidden","& .MuiTypography-root":{fontSize:{lg:"".concat(20+D,"px"),md:"16px",sm:"14px",xs:"14px"}}}}),(0,i.jsxs)(u.Z,{sx:{display:"flex"}
1,children:[(0,i.jsxs)(v.Z,{variant:"body1",sx:{display:"flex",alignItems:"center",fontSize:"12px",marginRight:"10px"},children:[(0,i.jsx)(j.Z,{sx:{fontSize:"12px",marginRight:"5px"}}),(null===e||void 0===e?void 0:e.viewCount)||0]}),(0,i.jsxs)(v.Z,{variant:"body1",sx:{display:"flex",alignItems:"center",fontSize:"12px"},children:[(0,i.jsx)(b.Z,{sx:{fontSize:"12px",marginRight:"5px"}}),(null===e||void 0===e?void 0:e.downloadCount)||0]})]})]})]}),(0,i.jsx)(S.default,{link:(0,k.$)(null===e||void 0===e||null===(n=e.Document)||void 0===n?void 0:n.url),name:null===e||void 0===e||null===(o=e.Document)||void 0===o?void 0:o.name,setView:ae,setDownloadCount:ce,setId:xe,id:null===e||void 0===e?void 0:e.id})]}),(0,i.jsx)(h.Z,{})]},t)}))]}),(0,i.jsx)(d.Z,{sx:{display:Y?"none":"block",padding:"0 20px"},children:null===q||void 0===q?void 0:q.map((function(e,t){return(0,i.jsx)(g.default,{Category:e,item:null===_||void 0===_?void 0:_.data},t)}))})]}):(0,i.jsx)(u.Z,{sx:{width:"100%",padding:"40px 0",display:"flex",justifyContent:"center"},children:(0,i.jsx)(v.Z,{children:"th"===I.locale?"\u0e44\u0e21\u0e48\u0e21\u0e35\u0e40\u0e2d\u0e01\u0e2a\u0e32\u0e23":"No document"})})]})})]})}}}]);

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.