PageSourceSearch

https://www.norsk-tipping.no/ow/8578-36fb1289493ce38a8f32.js

js norsk-tipping.no collected 2026-10-01 10:42:18 UTC 8,930 bytes, 2 lines download raw bytes

1"use strict";(self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[8578],{45066(e,l,n){n.d(l,{A:()=>p});var t=n(48431),o=n(22773),a=n(9624),i=n(73059),s=n.n(i),u=n(56779);const r=function(e,l){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:320,t=arguments.length>3&&void 0!==arguments[3]?arguments[3]:320;const o=1232,a=1232,i=[{l:57.748,y:1232},{l:58,y:1215},{l:59,y:1180},{l:59.4,y:1175},{l:59.5,y:1135},{l:60,y:1067},{l:61,y:991},{l:62,y:911},{l:63,y:829},{l:64,y:744},{l:65,y:654},{l:66,y:563},{l:67,y:469},{l:67.5,y:320},{l:68,y:310},{l:69,y:265},{l:69.8,y:200},{l:70,y:156},{l:71,y:43},{l:71.35,y:0}],s=[{l:1.225,x:0},{l:5,x:135},{l:6,x:140},{l:6.1,x:170},{l:8,x:260},{l:9,x:270},{l:10,x:334},{l:11,x:400},{l:13,x:525},{l:15,x:530},{l:20,x:711},{l:25,x:903},{l:30,x:1095},{l:33.642,x:1232}];n=n||o,t=t||a;let u=0,r=0;for(let e=1;e<s.length;e++)if(l<s[e].l||e===s.length-1){const n=(l-s[e-1].l)/(s[e].l-s[e-1].l);u=s[e-1].x+n*(s[e].x-s[e-1].x);break}for(let l=1;l<i.length;l++)if(e<i[l].l||l===i.length-1){const n=(e-i[l-1].l)/(i[l].l-i[l-1].l);r=i[l-1].y+n*(i[l].y-i[l-1].y);break}const d=100*u/o,c=100*r/a;return{x:Math.round(n*u/o),y:Math.round(t*r/a),percentX:d,percentY:c}},d="black",c="nabolagetResultMapOutlineContainer--lY01o",v="home--cG9gy",m="winnerPosition--ELWhj",g="position--NuO6t",y="animStart--mWv5v",E="animate--hUc3c",A="pin--AI7ij",L="map--b1ynq",S="address--D9B54",f="myAddressLabel--c_PEC",w="myAddress--X1P8L",p=e=>{var l,n,i;let{geoLocationQuality:p=!0,ownAddress:h,showPin:N=!0,showAdditionalInformation:x=!0,showWinners:b=!0,runAnimation:T=!1,altText:_,eventList:R,eventIdx:C=0,animationDone:M}=e;const[O,U]=(0,t.useState)(!1),X=(0,t.useRef)(null),Y={X:null==h||null===(l=h.geoLocation)||void 0===l?void 0:l.utm33Easting,Y:null==h||null===(n=h.geoLocation)||void 0===n?void 0:n.utm33Northing},I=e=>(e.x>290&&(e.x=290,e.y-=15),e),k=e=>e+-10,V=e=>e-22;(0,t.useEffect)(()=>{const e=()=>{M&&M(),U(!1)};T&&!O&&C>=0&&(U(!0),X&&(X.current=setTimeout(e,3e3)))},[C,T,O,M,U,X]),(0,t.useEffect)(()=>()=>{X&&clearTimeout(null==X?void 0:X.current)},[X]);const P=Y.X&&Y.Y&&(D=[Y],null==D?void 0:D.map(e=>{const l=(0,o.pd)([e.X,e.Y],"EPSG:32633","EPSG:4326"),n=r(l[1],l[0]),t=I(n);return{X:k(t.x),Y:V(t.y),id:e.id}}))[0];var D;return t.createElement("div",{className:c},t.createElement("div",{className:L,role:"img","aria-label":_,title:_},(null==h?void 0:h.address)&&x&&t.createElement("div",{className:S},t.createElement("div",{className:f},"Min adresse"),t.createElement("div",{className:w,"data-hj-suppress":!0},null==h?void 0:h.address.toLowerCase()),t.createElement("div",{className:w,"data-hj-suppress":!0},null==h?void 0:h.postalCode.toLowerCase()," ",null==h?void 0:h.city.toLowerCase())),p&&P&&N&&t.createElement("div",{className:v,style:{left:null==P?void 0:P.X,top:null==P?void 0:P.Y}},t.createElement(a.A,{size:"xl",color:d,className:A})),b&&(null===(i=(e=>null==e?void 0:e.map(e=>{const l=u.A.decode(e.location),n=r(l.lat,l.lon),t=I(n);return{X:k(t.x),Y:V(t.y),id:e.id}}))(R))||void 0===i?void 0:i.map((e,l)=>C>=l?((e,l)=>t.createElement("div",{key:e.id,className:m,style:{left:e.X,top:e.Y,zIndex:(null==R?void 0:R.length)+l}},t.createElement("div",{id:e.id,className:s()(g,{[y]:T&&l===C,[E]:l===C})},null==e?void 0:e.id)))(e,l):null))))}},30339(e,l,n){n.d(l,{A:()=>U});var t=n(48431),o=n(26946),a=n(28529),i=n(7088),s=n(25449),u=n(81837),r=n(98574),d=n(90853),c=n(28445),v=n(20679),m=n(99076),g=n(28281),y=n(48751),E=n(13658),A=n(89515),L=n(64487),S=n(2472),f=n(84471),w=n(56779),p=n(22773),h=n(12688),N=n(80964),x=n(32591),b=n(36133),T=n(73059),_=n.n(T);const R="mapContainer--F7DDN",C="backdrop--_Xcdh",M="zoom--ciqUN",O="disabled--PRTXJ",U=e=>{var l,n;let{address:T,altText:U="Kart over vinnernabolag",winnerGeoLocation:X,prizeList:Y=[],activePrizeId:I=1,showMap:k}=e;const V={X:null==T||null===(l=T.geoLocation)||void 0===l?void 0:l.utm33Easting,Y:null==T||null===(n=T.geoLocation)||void 0===n?void 0:n.utm33Northing},P=(0,o.d4)(x.Ny),[D,F]=(0,t.useState)(null),[G,j]=(0,t.useState)(null),[z,H]=(0,t.useState)(null),[Z,q]=(0,t.useState)(null),[J,B]=(0,t.useState)(null),[K,W]=(0,t.useState)(null),[Q,$]=(0,t.useState)(null),[ee,le]=(0,t.useState)(),[ne,te]=(0,t.useState)(null),[oe,ae]=(0,t.useState)(null),[ie,se]=(0,t.useState)(null),[ue,re]=(0,t.useState)(null),[de,ce]=(0,t.useState)(null),[ve,me]=(0,t.useState)(null),[ge,ye]=(0,t.useState)(1),Ee=(0,t.useRef)(null),Ae=[V.X,V.Y],Le=X?(0,b.n)((e=>{const l=w.A.decode(e),n=(0,p.Rb)([l.lon,l.lat],"EPSG:32633");return{X:n[0],Y:n[1]}})(X)):Ae;I!==ge&&ye(I);const Se={UTM33:"EPSG:32633",EXTENT:[-1e6,64e5,22e5,8e6],UNITS:"m"},fe={URL:"https://geoserver.placepoint.no/norsktipping/gwc/service/wms",LAYERS:"norsktipping:nabolaget_bespoke_map",VERSION:"1.1.1",CACHE_TS:"604800",RESOLUTIONS:[3125,781.25,195.3125,48.828125,12.20703125]},we=4,pe=e=>new m.A({geometry:new c.A(e)}),he=(0,t.useMemo)(()=>new g.Ay({stroke:new E.A({color:"rgba(255, 104, 23, 0.3)",width:1}),fill:new A.A({color:"rgba(255, 104, 23, 0.1)"})}),[]),Ne=(0,t.useMemo)(()=>new g.Ay({stroke:new E.A({color:"rgba(255, 104, 23, 0.3)",width:2}),fill:new A.A({color:"rgba(255, 104, 23, 0.3)"})}),[]),xe=(e,l)=>new m.A({geometry:new v.A(e,l)}),be=(e,l,n)=>{if(Y&&Y.length>0){var t;const o=Y[n-1]||0,a=new d.A({features:[xe(Le,(null==o||null===(t=o.distance)||void 0===t?void 0:t.originalValue)||0)]});e(a),l(new r.A({source:a,style:I===o.id?Ne:he}))}},Te=(0,t.useCallback)(()=>{var e,l;const n=(null==D?void 0:D.getView())||null,t=null==n?void 0:n.getZoom(),o=null==Ee||null===(e=Ee.current)||void 0===e?void 0:e.querySelector(".ol-control button:first-child"),a=null==Ee||null===(l=Ee.current)||void 0===l?void 0:l.querySelector(".ol-control button:last-child");Math.round(t)<=n.getMinZoom()?(null==a||a.classList.add(O),null==o||o.classList.remove(O)):Math.round(t)>=n.getMaxZoom()?(null==o||o.classList.add(O),null==a||a.classList.remove(O)):(null==o||o.classList.remove(O),null==a||a.classList.remove(O))},[D]);return(0,t.useEffect)(()=>{const e=null==D?void 0:D.getLayers().array_;if((null==e?void 0:e.length)>1){const l=e[ge+1];if(l){for(let l=2;l<e.length;l++)e[l].setStyle(he);l.setStyle(Ne)}}},[Ne,ge,he,D]),(0,t.useEffect)(()=>{(0,p.bF)(new f.A({code:Se.UTM33,extent:Se.EXTENT,units:Se.UNITS}
1)),(()=>{const e=new u.A({source:new N.A({url:fe.URL,projection:(0,p.Jt)(Se.UTM33),params:{LAYERS:fe.LAYERS,CACHE_TS:fe.CACHE_TS,FORMAT:"image/png",VERSION:fe.VERSION},tileGrid:new L.A({origin:(0,S.R)((0,p.Jt)(Se.UTM33).getExtent()),resolutions:fe.RESOLUTIONS})})}),l=new i.Ay({projection:(0,p.Jt)(Se.UTM33),center:Le,resolutions:fe.RESOLUTIONS,extent:void 0,zoom:we,enableRotation:!1});me(l),F(new a.A({target:"map",layers:[e],controls:[new s.A({className:M})],view:l,interactions:P?(0,h.NT)({dragPan:!1,pinchZoom:!1,doubleClickZoom:!1}):void 0}))})();const e=null==Ee?void 0:Ee.current,l=()=>null==e?void 0:e.blur();return null==e||e.addEventListener("focus",l),()=>null==e?void 0:e.removeEventListener("focus",l)},[]),(0,t.useEffect)(()=>{((null==Y?void 0:Y.length)||0)>0&&((()=>{const e=new d.A({features:[pe(Le)]});j(e);const l={image:new g.Ay({image:new y.A({src:"/ow/assets/lottery/nabolaget/pin.png",scale:.5,color:[255,104,23,1]})})};le(new r.A({source:e,style:l.image}))})(),be(H,te,1),be(q,ae,2),be(B,se,3),be(W,re,4),be($,ce,5))},[Y]),(0,t.useEffect)(()=>(D&&(Te(),null==D||D.getView().on("change:resolution",Te)),()=>{D&&(null==D||D.getView().un("change:resolution",Te))}),[Te,D]),(0,t.useEffect)(()=>{D&&(ee&&null!=D&&D.addLayer&&(null==D||D.addLayer(ee)),null!==ne&&(null==D||D.addLayer(ne)),null!==oe&&(null==D||D.addLayer(oe)),null!==ie&&(null==D||D.addLayer(ie)),null!==ue&&(null==D||D.addLayer(ue)),null!==de&&(null==D||D.addLayer(de)))},[D,ee,ne,oe,ie,ue,de]),(0,t.useEffect)(()=>{if(G){var e,l,n,t,o,a,i,s,u,r;if(G&&G.clear(),z&&z.clear(),Z&&Z.clear(),J&&J.clear(),K&&K.clear(),Q&&Q.clear(),G&&(null==G||G.addFeature(pe(Le))),z&&(null==z||z.addFeature(xe(Le,(null==Y||null===(e=Y[0])||void 0===e||null===(l=e.distance)||void 0===l?void 0:l.originalValue)||0))),Z&&(null==Z||Z.addFeature(xe(Le,(null==Y||null===(n=Y[1])||void 0===n||null===(t=n.distance)||void 0===t?void 0:t.originalValue)||0))),J&&(null==J||J.addFeature(xe(Le,(null==Y||null===(o=Y[2])||void 0===o||null===(a=o.distance)||void 0===a?void 0:a.originalValue)||0))),((null==Y?void 0:Y.length)||0)>3)null==K||K.addFeature(xe(Le,(null==Y||null===(i=Y[3])||void 0===i||null===(s=i.distance)||void 0===s?void 0:s.originalValue)||0));if(((null==Y?void 0:Y.length)||0)>4)null==Q||Q.addFeature(xe(Le,(null==Y||null===(u=Y[4])||void 0===u||null===(r=u.distance)||void 0===r?void 0:r.originalValue)||0));ve&&(null==ve||ve.setCenter(Le))}},[G,z,Z,J,K,Q,we,ve,Le,Y]),t.createElement(t.Fragment,null,t.createElement("h2",{className:"sr-only"},U),t.createElement("div",{id:"map",ref:Ee,className:_()(R,{[C]:k})}))}}}]);
2//# sourceMappingURL=8578-36fb1289493ce38a8f32.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.