PageSourceSearch

https://culturenow.org/_next/static/chunks/pages/collections/on_this_day/preview/[image]-8c79f2f85035aa61.js

js culturenow.org collected 2026-10-02 07:42:26 UTC 7,261 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[913],{49605:function(e,n,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/collections/on_this_day/preview/[image]",function(){return t(66179)}])},66179:function(e,n,t){"use strict";t.r(n),t.d(n,{__N_SSP:function(){return O},default:function(){return Z}});var i=t(34051),r=t.n(i),a=t(85893),o=t(67294),l=t(41248),u=t(11163),s=t(5152),c=t(95326),d=t(30381),v=t.n(d),f=t(96486);function m(e,n){(null==n||n>e.length)&&(n=e.length);for(var t=0,i=new Array(n);t<n;t++)i[t]=e[t];return i}function h(e,n){return function(e){if(Array.isArray(e))return e}(e)||function(e,n){var t=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var i,r,a=[],o=!0,l=!1;try{for(t=t.call(e);!(o=(i=t.next()).done)&&(a.push(i.value),!n||a.length!==n);o=!0);}catch(u){l=!0,r=u}finally{try{o||null==t.return||t.return()}finally{if(l)throw r}}return a}}(e,n)||function(e,n){if(!e)return;if("string"===typeof e)return m(e,n);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return m(e,n)}(e,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e){var n=e.collection,t=e.mode,i=e.fallbackDateField,r=void 0===i?"year":i,a=[],o=((null===n||void 0===n?void 0:n.images)||[]).map((function(e){var n=e.image_url||e.new_image_url||e.url;if(!n)return null;var i,a="";switch(e.image_id?a=e.image_id:e.image_url||e.new_image_url?a=function(e){var n=null===e||void 0===e?void 0:e.match(/\/([0-9a-fA-F-]{36})\//);return(null===n||void 0===n?void 0:n[1])||""}(e.image_url||e.new_image_url):e.id&&(a=e.id),t){case"in_this_photo":var o;i=(null===e||void 0===e||null===(o=e.taken_date)||void 0===o?void 0:o[r])||"Others";break;case"then_now":var l,u,s;i=(null===e||void 0===e||null===(l=e.related_images)||void 0===l||null===(u=l[0])||void 0===u||null===(s=u.taken_date)||void 0===s?void 0:s[r])||"Others";break;default:i=(null===e||void 0===e?void 0:e[r])||"Others"}return{id:a,url:n,date:i,type:e.type||(n.endsWith(".pdf")?"document":"image")}})).filter(Boolean),l=(0,f.groupBy)(o,"date"),u=!0,s=!1,c=void 0;try{for(var d,v=Object.entries(l)[Symbol.iterator]();!(u=(d=v.next()).done);u=!0){var m=h(d.value,2),_=m[0],p=m[1];p.length>0&&a.push({title:_,items:p})}}catch(y){s=!0,c=y}finally{try{u||null==v.return||v.return()}finally{if(s)throw c}}return{timeline:a,slider:a.flatMap((function(e){return e.items}))}}function p(e,n){var t=v()(n);switch(e){case"on_this_day":return"".concat(t.format("MMM D")," - On this Day");case"in_this_month":return"".concat(t.format("MMMM")," - In this Month");case"in_this_year":return"".concat(t.format("YYYY")," - In this Year");default:return""}}var y=t(95068),g=t(73938),w=t(61711),b=t(19882),x=t(79173),j=t(5374),k=t(51610),N=t(92642);function S(e,n,t,i,r,a,o){try{var l=e[a](o),u=l.value}catch(s){return void t(s)}l.done?n(u):Promise.resolve(u).then(i,r)}var M=(0,s.default)((function(){return Promise.all([t.e(8318),t.e(1060)]).then(t.bind(t,71060))}),{loadableGenerated:{webpack:function(){return[71060]}},ssr:!1}),E=(0,s.default)((function(){return t.e(6476).then(t.bind(t,46476))}),{loadableGenerated:{webpack:function(){return[46476]}},ssr:!1}),I=(0,s.default)((function(){return t.e(4177).then(t.bind(t,14177))}),{loadableGenerated:{webpack:function(){return[14177]}},ssr:!1});var O=!0,Z=function(e){var n,t=e.imageId,i=e.date,s=(0,o.useState)(!0),d=s[0],v=s[1],f=(0,o.useState)(!1),m=f[0],h=f[1],O=(0,o.useState)(null),Z=O[0],A=O[1],P=(0,l.I0)(),D=(0,u.useRouter)(),F=(0,l.v9)((function(e){return e.image})),C=(0,N.r)();(0,o.useEffect)((function(){var e;(e=r().mark((function e(){var n,t,a,o;return r().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={query:{bool:{must:[{term:{month:new Date(i).getMonth()}},{term:{day:new Date(i).getDate()}},{term:{entity_live:!0}},{term:{live:!0}}]}}},e.next=3,(0,c.performElasticSearch)("on_this_day_v2","",1e3,n);case 3:t=e.sent,a=["site","person","tour","map"],o=t.hits.filter((function(e){return a.includes(e.entity)})),A({name:p("on_this_day",i),images:o});case 7:case"end":return e.stop()}}),e)})),function(){var n=this,t=arguments;return new Promise((function(i,r){var a=e.apply(n,t);function o(e){S(a,i,r,o,l,"next",e)}function l(e){S(a,i,r,o,l,"throw",e)}o(void 0)}))})()}),[]),(0,o.useEffect)((function(){if(F){var e=(0,k.Zq)(F);if(!e)return;if(C(F,D.asPath))return;if((0,k.FS)(e,D.asPath))return;D.push({pathname:"/collections/on_this_day/preview/".concat(e,"?date=").concat(i),hash:"#".concat(e)},void 0,{shallow:!0})}}),[F]),(0,o.useEffect)((function(){if(Z){P({type:"entity",payload:Z});var e=_({collection:Z,mode:"on_this_day"}).slider,n=window.location.hash.slice(1),i=(0,k.tA)(e,t,n),r=e[i>=0?i:0];r&&!(0,k.Qk)(F,r)&&P({type:"image",payload:r})}}),[Z,t,F]);var Y=function(e){if(!Z)return[];var n=_({collection:Z,mode:"on_this_day"}),t=n.timeline,i=n.slider;return"timeline"===e?t:i};return(0,a.jsx)(a.Fragment,{children:m?(0,a.jsxs)(a.Fragment,{children:["2"===m?(0,a.jsx)(j.Z,{src:null===F||void 0===F||null===(n=F.url)||void 0===n?void 0:n.replace("original","web@4x")}):(0,a.jsxs)(a.Fragment,{children:[("image"===(null===F||void 0===F?void 0:F.type)||"document"===(null===F||void 0===F?void 0:F.type))&&(0,a.jsx)(I,{src:null===F||void 0===F?void 0:F.url}),"dzi"===(null===F||void 0===F?void 0:F.type)&&(0,a.jsx)(M,{image:F,id:"imgId-".concat(null===F||void 0===F?void 0:F.id)}),"then_now"===(null===F||void 0===F?void 0:F.type)&&(0,a.jsx)("div",{className:"then-now-container-center",children:(0,a.jsx)(E,{id:null===F||void 0===F?void 0:F.id})})]}),(0,a.jsxs)("div",{className:"zoomCloseButton",children:["2"===m&&"then_now"!==(null===F||void 0===F?void 0:F.type)&&(0,a.jsx)("span",{className:"me-1",children:(0,a.jsx)(y.Z,{size:"sm",icon:"full_screen",classes:"action-button",onClick:function(){return h("1")}})}),(0,a.jsx)(y.Z,{size:"sm",icon:"close",classes:"action-button",onClick:function(){return h(!1)}})]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"img-preview",children:[(0,a.jsx)("div",{className:"img-preview-title",children:null===Z||void 0===Z?void 0:Z.name}),(0,a.jsx)("div",{className:"img-preview-timeline print_hidden",children:(0,a.jsx)(g.Z,{data:function(){return Y("timeline")}})}),(0,a.jsx)(w.Z,{data:function(){return Y("slider")},isLabel:d,handleZoom:function(){return h("image"===(null===F||void 0===F?void 0:F.type)||"document"===(null===F||void 0===F?void 0:F.type)?"2":"1")}}),(0,a.jsx)("div",{className:"img-preview-actions print_hidden",children:(0,a.jsx)(b.Z,{goBack:function(){return D.push("/collections/on_this_day?date=".concat(i))},data:function(){return Y("slider")},isLabel:d,setIsLabel:v})})]}),(0,a.jsx)(x.Z,{useRemark:!0,imageData:null===Z||void 0===Z?void 0:Z.images,id:null===Z||void 0===Z?void 0:Z.id,type:"thenNow",data:function(){return Y("slider")}})]})})}}},function(e){e.O(0,[6737,8279,2433,7934,717,1964,5368,7009,6576,8413,1193,9774,2888,179],(function(){return n=49605,e(e.s=n);var n}));var n=e.O();_N_E=n}]);

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.