import i from"@arcgis/core/views/3d/environment/SunLighting";import t from"@arcgis/core/views/3d/environment/VirtualLighting";import e from"@arcgis/core/webscene/SunLighting";import{checkArg as n}from"../utilities/checkArg.js";export var Lighting;!function(r){r.toEsriApiLighting=function(e){n("lightingJson",e).isNotMissing();const r=e,s="virtual"===e.type?new t:new i;return e.hasOwnProperty("directShadows")&&(s.directShadowsEnabled=!!e.directShadows),s instanceof i&&(r.hasOwnProperty("datetime")&&(null==r.datetime?s.date=void 0:s.date=new Date(r.datetime)),r.hasOwnProperty("displayUTCOffset")&&(null==r.displayUTCOffset?s.displayUTCOffset=void 0:s.displayUTCOffset=r.displayUTCOffset)),s},r.fromEsriApiLighting=function(i){if(i)return i instanceof e?{datetime:i.date?.getTime(),directShadows:i.directShadowsEnabled,displayUTCOffset:i.displayUTCOffset,type:"sun"}:{directShadows:i.directShadowsEnabled,type:"virtual"}}}(Lighting||(Lighting={}));