define("@widget/CONTACT/bs-Component-437d813c.js",["exports","~/c/bs-data-aids"],(function(e,t){"use strict";function a(){return"undefined"!=typeof SDK&&"VTX"in SDK?new Date(14955489e5):new Date}const l=[new Date(2017,9,1),new Date(2017,9,2),new Date(2017,9,3),new Date(2017,9,4),new Date(2017,9,5),new Date(2017,9,6),new Date(2017,9,7)],o=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"00:00",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";const l=e.split(":"),o=parseInt(l[0],10),c=parseInt(l[1],10),r=a();return r.setHours(o),r.setMinutes(c),r.toLocaleString(t,{hour:"2-digit",minute:"2-digit"}).toLowerCase()};class c extends(global.React||guac.react).Component{constructor(e){super(e),this.toggleHoursView=this.toggleHoursView.bind(this),this.getHourLabel=this.getHourLabel.bind(this),this.state={collapsed:!0}}toggleHoursView(){this.setState({collapsed:!this.state.collapsed})}getHourLabel(e){const{staticContent:t,locale:a}=this.props;let l="";return l=e.closed?t.closed:e.byAppointmentOnly?t.byAppointment:`${o(e.openTime,a)} – ${o(e.closeTime,a)}`,l}render(){const{structuredHours:e,staticContent:o,locale:c,collapsible:r}=this.props,n=a().getDay(),g={borderSpacing:0,textAlign:"left",display:"inline-table"},s={display:"flex",marginTop:"xxsmall"},i={position:"relative",left:"xxsmall"},u=0===n?e.length-1:n-1,{hour:d}=e[u]||{};if(d&&r&&this.state.collapsed){const e=d.closed||d.byAppointmentOnly?`${o.today}`:`${o.openToday}`;return(global.React||guac.react).createElement("table",{style:g},(global.React||guac.react).createElement("tr",{"data-aid":t.D.CONTACT_HOURS_COLLAPSED_REND,style:{cursor:"pointer"},onClick:this.toggleHoursView},(global.React||guac.react).createElement("td",{style:{paddingRight:"medium"}},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Text,{"data-aid":t.D.CONTACT_HOURS_COLLAPSED_LABEL},e)),(global.React||guac.react).createElement("td",null,(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Text,{style:{whiteSpace:"nowrap",paddingLeft:"xxsmall"}},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Link,{"data-aid":t.D.CONTACT_HOURS_COLLAPSED_HR_LABEL,tag:"span"},this.getHourLabel(d)))),(global.React||guac.react).createElement("td",null,(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Text,{"data-aid":t.D.CONTACT_HOURS_COLLAPSED_ARROW},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Link,{group:"Group",tag:"span",style:s},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Icon,{icon:"chevronDown",size:"small",rotate:"0",style:i}))))))}return(global.React||guac.react).createElement("table",{style:g},e.map(((e,a)=>{let{hour:o}=e,g=(global._||guac.lodash).noop,u="auto",d="";r&&0===a&&(g=this.toggleHoursView,u="pointer",d=(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Text,{"data-aid":t.D.CONTACT_HOURS_COLLAPSED_ARROW},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Link,{group:"Group",tag:"span",style:s},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Icon,{icon:"chevronDown",size:"small",rotate:"180",style:i}))));const p=this.getHourLabel(o),b=n===o.dayOfWeek?"bold":"normal";return(global.React||guac.react).createElement("tr",{key:a,"data-aid":`${t.D.CONTACT_HOURS_DAY_REND}_${o.dayOfWeek}`,onClick:g,style:{cursor:u}},(global.React||guac.react).createElement("td",{style:{paddingRight:"medium"}},(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Text,{style:{fontWeight:b,wordBreak:"normal"}},function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"en-US";return l[e].toLocaleDateString(t,{weekday:"short"})}(o.dayOfWeek,c))),(global.React||guac.react).createElement("td",null,(global.React||guac.react).createElement((global.Core||guac["@wsb/guac-widget-core"]).UX2.Element.Text,{style:{fontWeight:b,whiteSpace:"nowrap",paddingLeft:"xxsmall"}},p)),(global.React||guac.react).createElement("td",null,d))})))}}c.propTypes={structuredHours:(global.PropTypes||guac["prop-types"]).array,staticContent:(global.PropTypes||guac["prop-types"]).object,locale:(global.PropTypes||guac["prop-types"]).string,collapsible:(global.PropTypes||guac["prop-types"]).bool},e.default=c,Object.defineProperty(e,"__esModule",{value:!0})})),"undefined"!=typeof window&&(window.global=window);
//# sourceMappingURL=bs-Component-437d813c.js.map
