function BuilkAPI(n){function e(n){return h(n)}function i(n){return t.PARAMS=t.PARAMS===""?t.PARAMS:"",angular.forEach(n,function(n,i){t.PARAMS+=i+"="+n+"&"}),t.PARAMS=t.PARAMS.substring(0,t.PARAMS.length-1),t.URL+="?"+t.PARAMS,this}function o(n){return t.URL=t.API+n,this}function s(){return n.get(t.URL).then(u)}function h(n){var i=[],t;if(typeof n.data=="object")for(t=0;t<n.data.length;t++)i.push(n.data[t]);else i.push(n.data);return i}var t=this;t.API=ROOT_DOMAIN+"/api/",t.PARAMS="",t.URL="";var c="th",r=o,l=i,u=e,f=s;return{module:r,params:i,get:f}}function CompanyBadgeController(n,t){var i=this;i.companySurrKey=n.companySurrKey,i.lang=n.userLanguage,i.badges=[],n.url="",t.getById(i.companySurrKey).then(function(n){i.badges=n});switch(n.userLanguage.toUpperCase()){case"TH":n.url="https://www.builk.com/th/company-profile/";break;case"ID":n.url="https://www.builk.com/en/company-profile/";break;case"LA":n.url="https://www.builk.com/th/company-profile/";break;case"MY":n.url="https://mm.builk.com/company-profile-mm/";break;default:n.url="https://www.builk.com/en/company-profile/"}}function Badge(n){function i(t){t=t||2002281;return n.module("badge").params({company_surr_key:t}).get()}var t=i;return{getById:t}}function companyBadge(){return{restrict:"EA",controller:"CompanyBadgeController",controllerAs:"badge",templateUrl:"/Scripts/Areas/CompanyProfile_PB/badge/views/company.badge.view.html",scope:{companySurrKey:"=",userLanguage:"="}}}function CompanySimilarController(n,t){var r=this;r.similars={},r.companyId=n.companyId,r.companyTypeId=n.companyTypeId,r.skip=n.skip,r.take=n.take,n.temp=[],n.lang=lang,n.companyCountry=lang,r.lang=n.lang,r.similarJU={},r.similarTemp=[],n.count=0,n.result=[],n.result2=[],n.result3=[],n.result4=[],n.result5=[],n.result6=[],n.result7=[],n.result8=[],n.result9=[],n.result10=[],n.similarTemp=[],n.similarTemp2=[],n.similarTemp3=[],n.similarTemp4=[],n.similarTemp5=[],n.similarTemp6=[],n.similarTemp7=[],n.similarTemp8=[],n.similarTemp9=[],n.similarTemp10=[],t.getSimilarJu(2002281,n.companyCountry).then(function(r){n.similarJU=r,angular.forEach(r,function(u){t.getById(u.Id).then(function(t){if(n.temp.push(t[0].company_type_name),n.count=n.count+1,n.count==10)for(i=0;i<n.similarJU.length;i++){if(i<6&&n.result.length<6&&(n.result.push(r[i]),n.similarTemp.push(n.temp[i])),i>0&&n.result2.length<6&&(n.result2.push(r[i]),n.similarTemp2.push(n.temp[i])),i>1&&n.result3.length<6&&(n.result3.push(r[i]),n.similarTemp3.push(n.temp[i])),i>2&&n.result4.length<6&&(n.result4.push(r[i]),n.similarTemp4.push(n.temp[i])),i>3&&n.result5.length<6&&(n.result5.push(r[i]),n.similarTemp5.push(n.temp[i])),i>4&&n.result6.length<6&&(n.result6.push(r[i]),n.similarTemp6.push(n.temp[i]),i==n.similarJU.length-1))for(j=0;j<6-n.result6.length;j++)n.result6.push(r[j]),n.similarTemp6.push(n.temp[i]);i>5&&n.result7.length<6&&(n.result7.push(r[i]),n.similarTemp7.push(n.temp[i]),i==n.similarJU.length-1&&(n.result7.push(r[0]),n.result7.push(r[1]),n.similarTemp7.push(n.temp[0]),n.similarTemp7.push(n.temp[1]))),i>6&&n.result8.length<6&&(n.result8.push(r[i]),n.similarTemp8.push(n.temp[i]),i==n.similarJU.length-1&&(n.result8.push(r[0]),n.result8.push(r[1]),n.result8.push(r[2]),n.similarTemp8.push(n.temp[0]),n.similarTemp8.push(n.temp[1]),n.similarTemp8.push(n.temp[2]))),i>7&&n.result9.length<6&&(n.result9.push(r[i]),n.similarTemp9.push(n.temp[i]),i==n.similarJU.length-1&&(n.result9.push(r[0]),n.result9.push(r[1]),n.result9.push(r[2]),n.result9.push(r[3]),n.similarTemp9.push(n.temp[0]),n.similarTemp9.push(n.temp[1]),n.similarTemp9.push(n.temp[2]),n.similarTemp9.push(n.temp[3]))),i>8&&n.result10.length<6&&(n.result10.push(r[i]),n.similarTemp10.push(n.temp[i]),i==n.similarJU.length-1&&(n.result10.push(r[0]),n.result10.push(r[1]),n.result10.push(r[2]),n.result10.push(r[3]),n.result10.push(r[4]),n.similarTemp10.push(n.temp[0]),n.similarTemp10.push(n.temp[1]),n.similarTemp10.push(n.temp[2]),n.similarTemp10.push(n.temp[3]),n.similarTemp10.push(n.temp[4])))}})})}),angular.element(".multi-item-carousel").carousel({interval:2e3})}function companyProfile(){return{restrict:"EA",controller:"CompanyProfileController",controllerAs:"profile",templateUrl:"/Scripts/Areas/CompanyProfile_PB/profile/views/company.profile.view.cshtml",scope:{companySurrKey:"=",lang:lang}}}function companySimilar(){return{restrict:"EA",controller:"CompanySimilarController",controllerAs:"similar",templateUrl:"/Scripts/Areas/CompanyProfile_PB/profile/views/company.similar.view.cshtml",scope:{companyId:"=",companyTypeId:"=",skip:"=",take:"="}}}function CompanyProfile(n){function r(i,r){i=i||2002281,r=r||t;return n.module("Company").params({ids:i,lang:r}).get()}function u(t,i,r,u){return n.module("Company").params({companyId:t,companyTypeId:i,skip:r,take:u}).get()}function f(t,i){return n.module("Company").params({comJu:t,country:i}).get()}var t="th",i=r;return{getById:i,getSimilar:u,getSimilarJu:f}}function Product(n){function o(t,r,u){t=t||2002281,r=r||i,u=u||2002825;return n.module("product").params({company_surr_key:t,lang:r,productids:u}).get()}function s(t,i,r){return n.module("product").params({ids:t,page:i,perPage:r}).get()}function h(t,i,r){return n.module("Product").params({page:t,perPage:i,productIds:r}).get()}function c(t){return n.module("Product").params({productIds:t}).get()}function t(t){return n.module("Product").params({ids:t}).get()}var i="th",r=o,u=s,f=h,e=c,t=t;return{getById:r,getPerPage:u,getImage:f,getImageQuantity:e,getQuantityById:t}}function Project(n){function f(t){t=t||2002281;return n.module("project").params({ids:t}).get()}function e(t,i,r){return n.module("project").params({ids:t,page:i,perPage:r}).get()}function o(t,i,r){return n.module("Project").params({page:t,perPage:i,referenceIds:r}).get()}function s(t){return n.module("Project").params({referenceIds:t}).get()}var h="th",t=f,i=e,r=o,u=s;return{getById:t,getPerPage:i,getImage:r,getImageQuantity:u}}function Reference(n){function f(t){t=t||2002281;return n.module("Reference").params({ids:t}).get()}function e(t,i,r){return n.module("Reference").params({ids:t,page:i,perPage:r}).get()}function o(t,i,r){return n.module("Reference").params({page:t,perPage:i,referenceIds:r}).get()}function s(t){return n.module("Reference").params({referenceIds:t}).get()}var h="th",t=f,i=e,r=o,u=s;return{getById:t,getPerPage:i,getImage:r,getImageQuantity:u}}function Team(n){function i(t){t=t||2002281;return n.module("team").params({ids:t}).get()}var t=i;return{getById:t}}var app=angular.module("app.company",["app.company.profile","ngSanitize","app.company.badge","app.company.product","app.company.project","app.company.team","app.company.reference"]);app.directive("format",function(n){return{require:"?ngModel",link:function(t,i,r,u){u&&(u.$formatters.unshift(function(){return n(r.format)(u.$modelValue)}),u.$parsers.unshift(function(t){var u,r;return console.log("viewValue "+t),u=!1,t.substr(t.length-1,1)=="."&&(u=!0),r=t.replace(/[^\d|\-+|\.+]/g,""),console.log("plainNumber "+r),i.val(n("number")(r)+(u?".":"")),console.log("plainNumber filter "+r),r}))}}}),angular.module("app.company.profile",["ui.bootstrap"]),angular.module("app.company.badge",[]),angular.module("app.company.product",[]),angular.module("app.company.project",[]),angular.module("app.company.reference",[]),angular.module("app.company.team",[]),angular.module("app.company").factory("BuilkAPI",["$http",BuilkAPI]),angular.module("app.company.profile").controller("CompanyBadgeController",["$scope","Badge",CompanyBadgeController]),angular.module("app.company.badge").factory("Badge",["BuilkAPI",Badge]),angular.module("app.company.badge").directive("companyBadge",companyBadge),angular.module("app.company.profile").controller("CompanySimilarController",["$scope","CompanyProfile",CompanySimilarController]),angular.module("app.company.profile").directive("companyProfile",companyProfile),angular.module("app.company.profile").directive("companySimilar",companySimilar),angular.module("app.company.profile").factory("CompanyProfile",["BuilkAPI",CompanyProfile]),angular.module("app.company.product").factory("Product",["BuilkAPI",Product]),angular.module("app.company.project").factory("Project",["BuilkAPI",Project]),angular.module("app.company.reference").factory("Reference",Reference),Reference.$inject=["BuilkAPI"],angular.module("app.company.team").factory("Team",["BuilkAPI",Team])