{"version":3,"sources":["scripts/app-98338a4a95.js"],"names":["angular","module","ReplaceImagePopupComponent","$log","$scope","$inject","component","templateUrl","controller","controllerAs","bindings","confirm","CustomizablePopupComponent","formsService","ordersService","$timeout","submitForm","triggerFormValidation","vm","form","$valid","isFormHidden","data","extend","formData","product","type","subscribeProduct","then","res","debug","err","error","forEach","$error","required","field","$setDirty","this","hasError","showError","canSave","RollerComponent","isChainVisible","orderMetadata","motorization","getControlClasses","control-black","controlColor","control-white","getFasciaClasses","hidden","fascia","fascia-white","fascia-aluminium","fascia-black","getChainColors","getBlackChainColors","getWhiteChainColor","getDefaultChainColors","start","center","stop","getChainClasses","align-right","controlPosition","isRollerRegular","rollType","StudioComponent","$uibModal","$state","$rootScope","orderModalService","debounce","modalService","cloudConvertService","cartService","selectHelperService","businessRules","fileHelperService","orderHelperService","$parse","$document","pickOptions","pickValues","selectOptions","$broadcast","collection","property","item","ignoreToggle","opt","pickValue","options","fieldKey","handleWidthChange","getMainFormOptions","handleOrderMetadataChange","orderCost","getEstimatedCost","openDialog","inputFileSelector","element","trigger","openModal","templateFilename","show","handleDragFile","file","handleFileSelect","applyFile","toBlob","blob","imageBlob","$apply","extension","getFileExtension","name","extArr","indexOf","convertFile","isImageProcessing","beginCheckout","hasFormsValidationPassed","cropOptions","crop","canvas","croppedImage","cropBoxData","previewImage","blobToDataURL","go","callback","fileReader","FileReader","onload","e","target","result","readAsDataURL","toggleFormDirty","imageOptionsForm","designOptionsForm","activeTab","isDropdownDisabled","isDisabled","updateCropperPosition","$cropArea","length","width","height","rollerOffset","paddingBottom","marginTop","chainOffset","$cropperContainer","topOffset","parseInt","css","containerHeight","cropAreaHeight","bottomOffset","margin-top","margin-bottom","createWatchers","slice","call","arguments","map","key","onKeyUp","escapeKey","keyCode","printedPanelsPopup","wrappedFinePopup","replacePopup","$digest","fractionalInchesOptions","getFractionalInchesOptions","widthOptions","getInchesOptions","heightOptions","getOrderMetadata","formOptions","getFormOptions","widthSliderOptions","hideLimitLabels","floor","ceil","heightSliderOptions","$watchGroup","execute","bind","on","isCartEmpty","$on","off","ContactService","API","apiHelperService","createRequest","req","method","url","CONTACT","sendHTTPRequest","factory","CloudConvertService","$http","processUrl","createProcessId","fd","FormData","append","upload","getStatus","download","output","inputFormat","headers","Authorization","API_KEY","inputformat","outputformat","input","post","transformRequest","identity","Content-Type","undefined","get","responseType","BusinessRules","rules","getRules","rule","condition","action","rulesKeys","$q","$modal","orderModal","reject","backdrop","keyboard","onHide","hide","$promise","OrderModalController","flashService","closeModal","handleOrderStateChange","event","isSuccessful","isProcessed","progress","progressData","handleOrderProgressChange","obj","index","value","getMotorization","modalRef","ModalController","contactService","contactForm","isSubmitButtonHidden","phone","phoneNumber","parse","toLowerCase","split","join","overflowSubjectService","next","self","observers","observer","subscribe","push","ngModelCtrl","$dirty","$invalid","ngFormCtrl","initService","clearFlashMessage","flash","keepAfterLocationChange","success","message","isDataLoading","info","warning","service","AWS_S3_UPLOAD","Upload","reader","Promise","resolve","evt","uploadImage","fileExtension","cleanedFilename","cleanFilename","String","Date","getTime","cleanedFilenameAndExtension","Blob","s3url","AWSAccessKeyId","acl","policy","signature","filename","response","config","progressPercentage","loaded","total","inputString","timestamp","now","outputString","replace","outputStringWithTimestamp","re","exec","dataURItoBlob","dataURI","byteString","atob","mimeString","ab","ArrayBuffer","ia","Uint8Array","i","charCodeAt","ENV_VARS","s3BucketDomain","cdnDomain","status","statusText","panelService","$aside","$stateParams","template","aside","container","placement","animation","destroy","func","wait","immediate","timeout","deferred","defer","context","args","later","apply","callNow","cancel","promise","StatesService","getAll","abbreviation","CountriesService","code","CropperDirective","restrict","scope","scale","onReady","link","attrs","cleanup","cropper","readyListener","removeEventListener","moveListener","init","image","Cropper","guides","zoomOnTouch","zoomOnWheel","cropBoxResizable","autoCropArea","aspectRatio","minCropBoxWidth","dragMode","addEventListener","handleScaleChange","handleRatioChanged","cachedCropBoxData","setCropBoxData","handleCropMove","canvasData","getCanvasData","getCropBoxData","widthRatio","heightRatio","dimensionsRatio","zoomRatioOffset","$watch","handleCrop","scalePercent","ratio","setAspectRatio","convertInchesToPx","getCroppedCanvas","imageSmoothingEnabled","imageSmoothingQuality","ev","directive","ImageUploadComponent","$element","preventEventBubble","preventDefault","stopPropagation","selectFile","files","validateFile","handleFile","$event","dragEventCounter","$uploadWrapper","children","first","addClass","removeClass","originalEvent","dataTransfer","AddressComponent","statesService","countriesService","getStates","states","pickName","mapToItem","getCountries","option","label","countries","require","DropdownComponent","getCurrentValue","placeholder","ngModel","getCurrentValueIndex","findIndex","toggle","disabled","isOpened","close","select","selected","getOptionsHeight","dropdownOptions","find","maxItems","dropdownHeight","Math","min","abs","offsetHeight","hasRichContent","html","hashKey","random","StripeService","createHandler","StripeCheckout","configure","stripeKey","locale","shippingAddress","billingAddress","token","createToken","card","stripe","createElements","elements","fonts","family","weight","src","unicodeRange","createCard","style","getElementsStyle","create","createCardExpiration","createCardCvc","override","base","color","fontSize","fontFamily","::placeholder","invalid","Stripe","OrdersService","ORDERS","OrderHelperService","metadata","baselineCost","dimensionsCost","calcSizeCost","fasciaOptions","getFasciaOptions","motorizationOptions","getMotorizationOptions","amenitiesCost","findPriceByValue","inches","convertPxToInches","pixels","price","getFabricStyleOptions","description","toUpperCase","pricing","getFasciaPricing","calcDimensionIndex","widthFraction","modalFilename","getImageOrientationOptions","getMountingStyleOptions","getRollTypeOptions","getMotorPositionOptions","getControlPositionOptions","getControlColorOptions","isVisible","disabledMessage","count","Array","val","toInchesOption","widthId","heightId","heightFraction","offset","getShadesPricing","whole","fraction","max","step","getOrderTax","isTaxIncluded","taxesRatings","getTaxesRatings","state","Object","keys","getTotalOrderCost","California","getBaseMetadataKeys","CartService","remove","createOrderMetadata","country","HomeController","CheckoutController","stripeService","initStripeElements","stripeCard","mount","editShade","removeShade","orderTax","submitOrder","shippingForm","isOrderProcessing","handleStripeToken","validateStripeFields","setTimeout","showOrderModal","originalImage","imagesPromises","all","urls","createOrder","stripeObj","croppedUrl","originalUrl","id","email","shipmentAddress","amount","totalAmount","totalOrderCost","parseMetadata","mainFormOptions","concat","metadataKeys","calculateOrderCost","includes","stripeErrors","cvc","expiry","isBillingAddressHidden","paymentForm","phonenumberFilter","tel","toString","trim","match","city","number","filter","gtEventStartDate","items","filteredItems","cnt","today","eventStartDate","startDate","console","log","formatTime","withtime","moment","format","capitalize","substring","addTargetBlank","isExternalUrl","hostname","search","appDomain","content","tree","anchor","attr","cdnFilter","topNavCollapse","$window","pageYOffset","boolChangeClass","MainController","$location","isSidebarOpened","appName","appDesc","bodyId","toState","toParams","fromState","fromParams","bodyClass","runBlock","Notification","ngMeta","external","open","customUrl","redirectTo","location","headerPartial","headerInverseToggle","run","routeConfig","$stateProvider","$urlRouterProvider","$urlMatcherFactoryProvider","strictMode","abstract","parent","meta","title","constant","apiUrl","version","$logProvider","$locationProvider","$httpProvider","$analyticsProvider","ScrollBarsProvider","$modalProvider","$provide","debugEnabled","hashPrefix","html5Mode","enabled","requireBase","defaults","scrollInertia","setHeight","settings","ga","additionalAccountNames","additionalAccountHitTypes","pageview","exception","ecommerce","userTiming","setUserProperties","userId","disableEventTracking","disablePageTracking","enhancedEcommerce","transport","$templateCache","put"],"mappings":"CAAA,WACI,YAEAA,SAAQC,OAAO,cAInB,WACE,YAaA,SAASC,GAA2BC,EAAMC,IAX1CF,EAA2BG,SAAW,OAAQ,UAA9CL,QACGC,OAAO,QACPK,UAAU,mBACTC,YAAa,kEACbC,WAAYN,EACZO,aAAc,KACdC,UACEC,QAAW,UAUnB,WACE,YAaA,SAASC,GAA2BT,EAAMU,EAAcC,EAAeV,EAAQW,GAa3E,QAASC,KAEP,GADAC,EAAsBC,EAAGC,MACpBD,EAAGC,KAAKC,OAAb,CAGAF,EAAGG,cAAe,CAElB,IAAIC,GAAOtB,QAAQuB,UAAWL,EAAGM,UAAYC,QAASP,EAAGQ,MACzDZ,GAAca,iBAAiBL,GAC5BM,KAAK,SAASC,GACb1B,EAAK2B,MAAM,qBAAsBD,KAFrC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,iCAAiC,IACpDD,EAAeC,IAAI,iCAAiC,qUACpDD,EAAeC,IAAI,0BAA0B,0LAC7CD,EAAeC,IAAI,uCAAuC,k4HAC1DD,EAAeC,IAAI,+BAA+B,+EAClDD,EAAeC,IAAI,yDAAyD,+4BAC5ED,EAAeC,IAAI,mDAAmD,2iCACtED,EAAeC,IAAI,yDAAyD,iOAC5ED,EAAeC,IAAI,kDAAkD,0/GACrED,EAAeC,IAAI,6CAA6C;AAChED,EAAeC,IAAI,6CAA6C,63MAChED,EAAeC,IAAI,mDAAmD,otDACtED,EAAeC,IAAI,sDAAsD,+wCACzED,EAAeC,IAAI,oDAAoD,47EACvED,EAAeC,IAAI,8CAA8C,kmDACjED,EAAeC,IAAI,kDAAkD,q/FACrED,EAAeC,IAAI,yDAAyD,+2EAC5ED,EAAeC,IAAI,sDAAsD,ozCACzED,EAAeC,IAAI,oDAAoD,s0GACvED,EAAeC,IAAI,wDAAwD,qxGAC3ED,EAAeC,IAAI,iDAAiD,g/FACpED,EAAeC,IAAI,4CAA4C;AAC/DD,EAAeC,IAAI,4EAA4E,2uBAC/FD,EAAeC,IAAI,kEAAkE","file":"scripts/app-98338a4a95.js","sourcesContent":["(function() {\n 'use strict';\n\n angular.module('home', []);\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('home')\n .component('appReplacePopup', {\n templateUrl: 'app/main/home/popups/replace-popup/replace-popup.component.html',\n controller: ReplaceImagePopupComponent,\n controllerAs: 'vm',\n bindings: {\n 'confirm': '&'\n }\n });\n\n function ReplaceImagePopupComponent($log, $scope) {\n var vm = this;\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('home')\n .component('appCustomizablePopup', {\n templateUrl: 'app/main/home/popups/customizable-popup/customizable-popup.component.html',\n controller: CustomizablePopupComponent,\n controllerAs: 'vm',\n bindings: {\n type: '<',\n }\n });\n\n function CustomizablePopupComponent($log, formsService, ordersService, $scope, $timeout) {\n var vm = this;\n\n // error handling utility\n $scope.hasError = formsService.hasError;\n $scope.showError = formsService.showError;\n $scope.canSave = formsService.canSave;\n\n vm.submitForm = submitForm;\n\n vm.formData = {};\n vm.isFormHidden = false;\n\n function submitForm() {\n triggerFormValidation(vm.form);\n if (!vm.form.$valid) {\n return;\n }\n vm.isFormHidden = true;\n\n var data = angular.extend({}, vm.formData, { product: vm.type });\n ordersService.subscribeProduct(data)\n .then(function(res) {\n $log.debug('customizable-popup', res);\n })\n .catch(function(err) {\n $log.error('customizable-popup', err);\n });\n }\n\n function triggerFormValidation(form) {\n angular.forEach(form.$error.required, function(field) {\n field.$setDirty();\n });\n }\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('home')\n .component('appRoller', {\n templateUrl: 'app/main/home/roller/roller.component.html',\n controller: RollerComponent,\n controllerAs: 'vm',\n bindings: {\n orderMetadata: '<',\n }\n });\n\n function RollerComponent($log) {\n var vm = this;\n \n vm.getChainColors = getChainColors;\n vm.getFasciaClasses = getFasciaClasses;\n vm.isRollerRegular = isRollerRegular;\n vm.getControlClasses = getControlClasses;\n vm.getChainClasses = getChainClasses;\n vm.isChainVisible = isChainVisible;\n\n function isChainVisible() {\n return vm.orderMetadata.motorization === 'No Motorization';\n }\n \n function getControlClasses() {\n return {\n 'control-black': vm.orderMetadata.controlColor === 'Black',\n 'control-white': vm.orderMetadata.controlColor === 'White',\n };\n }\n\n function getFasciaClasses() {\n return {\n 'hidden': vm.orderMetadata.fascia === 'None',\n 'fascia-white': vm.orderMetadata.fascia === 'White',\n 'fascia-aluminium': vm.orderMetadata.fascia === 'Anodized Aluminum',\n 'fascia-black': vm.orderMetadata.fascia === 'Black',\n };\n }\n\n function getChainColors() {\n switch (vm.orderMetadata.controlColor) {\n case 'Black': return getBlackChainColors();\n case 'White': return getWhiteChainColor();\n default: return getDefaultChainColors();\n }\n }\n\n function getBlackChainColors() {\n return {\n start: '#4f4f4f',\n center: '#5f5f5f',\n stop: '#3e3e3e'\n };\n }\n\n function getWhiteChainColor() {\n return {\n start: '#f5f5f5',\n center: '#ffffff',\n stop: '#f5f5f5'\n };\n }\n\n function getDefaultChainColors() {\n return {\n start: '#EBEBEB',\n center: '#DCDDDF',\n stop: '#C4C5C7'\n };\n }\n\n function getChainClasses() {\n return {\n 'align-right': vm.orderMetadata.controlPosition === 'Right Side'\n };\n }\n\n function isRollerRegular() {\n return vm.orderMetadata.rollType === 'Regular Roll';\n }\n }\n\n})();\n\n(function() {\n\t'use strict';\n\n\tangular.module('home').component('appStudio', {\n\t\ttemplateUrl: 'app/main/home/studio/studio.component.html',\n\t\tcontroller: StudioComponent,\n\t\tcontrollerAs: 'vm',\n\t});\n\n\tfunction StudioComponent(\n\t\t$log,\n\t\t$uibModal,\n\t\t$state,\n\t\t$rootScope,\n\t\tformsService,\n\t\tordersService,\n\t\torderModalService,\n\t\tdebounce,\n\t\tmodalService,\n\t\tcloudConvertService,\n\t\tcartService,\n\t\tselectHelperService,\n\t\tbusinessRules,\n\t\tfileHelperService,\n\t\torderHelperService,\n $parse,\n $document,\n\t\t$scope,\n\t\t$timeout\n\t) {\n\t\tvar vm = this;\n\n\t\t// error handling utility\n\t\t$scope.hasError = formsService.hasError;\n\t\t$scope.showError = formsService.showError;\n\t\t$scope.canSave = formsService.canSave;\n\n\t\tvm.fractionalInchesOptions = orderHelperService.getFractionalInchesOptions();\n\t\tvm.widthOptions = orderHelperService.getInchesOptions(24, 168);\n\t\tvm.heightOptions = orderHelperService.getInchesOptions(24, 162);\n\t\tvm.orderMetadata = cartService.getOrderMetadata();\n\t\tvm.selectOptions = orderHelperService.getMainFormOptions(vm.orderMetadata);\n\t\tvm.formOptions = orderHelperService.getFormOptions();\n\n\t\tvm.widthSliderOptions = { hideLimitLabels: true, floor: 24, ceil: 168 };\n\t\tvm.heightSliderOptions = { hideLimitLabels: true, floor: 24, ceil: 162 };\n\n\t\tvm.cropOptions = {};\n\t\tvm.cropBoxData = {};\n\t\tvm.orderCost = null;\n\t\tvm.imageBlob = null;\n vm.isImageProcessing = false;\n\n\t\tvm.openDialog = openDialog;\n\t\tvm.handleFileSelect = handleFileSelect;\n\t\tvm.handleDragFile = handleDragFile;\n\t\tvm.beginCheckout = beginCheckout;\n\t\tvm.openModal = openModal;\n\t\tvm.isDropdownDisabled = isDropdownDisabled;\n\t\tvm.updateCropperPosition = updateCropperPosition;\n\n\t\thandleOrderMetadataChange();\n\n\t\t$scope.$watchGroup(\n\t\t\tcreateWatchers('width', 'height'),\n\t\t\tupdateCropperPosition\n\t\t);\n\t\t$scope.$watchGroup(\n\t\t\tcreateWatchers('width', 'widthFraction'),\n\t\t\tdebounce(handleWidthChange, 500)\n\t\t);\n\n\t\t$scope.$watchGroup(\n\t\t\tcreateWatchers(\n\t\t\t\t'width',\n\t\t\t\t'height',\n\t\t\t\t'fascia',\n\t\t\t\t'motorization',\n\t\t\t\t'widthFraction',\n\t\t\t\t'heightFraction'\n\t\t\t),\n\t\t\thandleOrderMetadataChange\n\t\t);\n\t\t$scope.$watchGroup(\n\t\t\tbusinessRules.createWatchers(vm),\n\t\t\tbusinessRules.execute.bind(businessRules, vm.orderMetadata)\n\t\t);\n\n\t\t(function init() {\n $document.on('keyup', onKeyUp);\n\n\t\t\tvm.orderMetadata = cartService.getOrderMetadata();\n var isCartEmpty = !vm.orderMetadata.imageBlob;\n \n\t\t\tif (isCartEmpty) {\n\t\t\t\treturn pickOptions();\n\t\t\t}\n vm.imageBlob = vm.orderMetadata.imageBlob;\n $rootScope.$broadcast('cropBoxDataUpdate', vm.orderMetadata.cropBoxData);\n })();\n \n $scope.$on('$destroy', function() {\n $document.off('keyup', onKeyUp);\n });\n\n\t\tfunction pickOptions() {\n\t\t\tpickValues(vm.selectOptions, 'value');\n\t\t\t$timeout(function() {\n\t\t\t\t$scope.$broadcast('rzSliderForceRender');\n\t\t\t});\n\t\t}\n\n\t\tfunction pickValues(collection, property) {\n\t\t\tif (!collection || !collection.forEach) return;\n\n\t\t\tcollection.forEach(function(item) {\n\t\t\t\tif (item.ignoreToggle) return;\n\n\t\t\t\tvar opt = selectHelperService.pickValue(item.options);\n\t\t\t\tvm.orderMetadata[item.fieldKey] = property ? opt[property] : opt;\n\t\t\t});\n\t\t}\n\n\t\tfunction handleWidthChange() {\n\t\t\tvm.selectOptions = orderHelperService.getMainFormOptions(\n\t\t\t\tvm.orderMetadata\n\n\t\t\t);\n\t\t}\n\n\t\tfunction handleOrderMetadataChange() {\n\t\t\tvm.orderCost = orderHelperService.getEstimatedCost(vm.orderMetadata);\n\t\t}\n\n\t\tfunction openDialog() {\n\t\t\tvar inputFileSelector = '#file';\n\t\t\tangular.element(inputFileSelector).trigger('click');\n\t\t}\n\n\t\tfunction openModal(templateFilename) {\n\t\t\tmodalService.show(templateFilename);\n\t\t}\n\n\t\tfunction handleDragFile(file) {\n\t\t\tvm.file = file;\n\t\t\thandleFileSelect();\n\t\t}\n\n\t\tfunction handleFileSelect() {\n\t\t\tif (!vm.file) {\n\t\t\t\treturn;\n }\n // vm.orderMetadata.scale = 100;\n // vm.orderMetadata.width = 50;\n // vm.orderMetadata.height = 50;\n $timeout(function () {\n $scope.$broadcast('rzSliderForceRender');\n });\n\n\t\t\tvar extension = fileHelperService.getFileExtension(vm.file.name);\n\t\t\tvar extArr = ['psd', 'tiff', 'pdf', 'eps', 'ai', 'tif', 'nef', 'raw', 'cr2', 'crw', 'svg', 'sk'];\n\n\t\t\tfunction applyFile() {\n\t\t\t\tfileHelperService.toBlob(vm.file).then(function(blob) {\n\t\t\t\t\tvm.imageBlob = blob;\n\t\t\t\t\t$scope.$apply();\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (extArr.indexOf(extension) < 0) {\n\t\t\t\treturn applyFile();\n\t\t\t}\n convertFile(extension);\n }\n \n function convertFile(extension) {\n vm.isImageProcessing = true;\n\n\t\t\tcloudConvertService\n .convertFile(vm.file, extension)\n .then(function(blob) {\n vm.imageBlob = blob;\n vm.isImageProcessing = false;\n })\n .catch(function(err) {\n $log.error('studioComponent-error', error);\n vm.isImageProcessing = false;\n });\n }\n\n function blobToFile(theBlob, fileName) {\n theBlob.lastModifiedDate = new Date();\n theBlob.name = fileName;\n return theBlob;\n }\n\n\t\tfunction beginCheckout() {\n\t\t\tif (!hasFormsValidationPassed() || !vm.cropOptions.crop) return;\n\n\t\t\tvar canvas = vm.cropOptions.crop();\n\t\t\tcanvas.toBlob(function(croppedImage) {\n\t\t\t\tvm.orderMetadata.imageBlob = vm.imageBlob;\n\t\t\t\tvm.orderMetadata.croppedImage = croppedImage;\n\t\t\t\tvm.orderMetadata.cropBoxData = vm.cropBoxData;\n\t\t\t\tvm.orderMetadata.previewImage = canvas;\n\n\t\t\t\tblobToDataURL(croppedImage, function(previewImage) {\n\t\t\t\t\tvm.orderMetadata.previewImage = previewImage;\n\t\t\t\t\t$state.go('checkout');\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\n\t\tfunction blobToDataURL(blob, callback) {\n\t\t\tvar fileReader = new FileReader();\n\t\t\tfileReader.onload = function(e) {\n\t\t\t\tcallback(e.target.result);\n\t\t\t};\n\t\t\tfileReader.readAsDataURL(blob);\n\t\t}\n\n\t\tfunction hasFormsValidationPassed() {\n\t\t\ttoggleFormDirty(vm.imageOptionsForm);\n\t\t\ttoggleFormDirty(vm.designOptionsForm);\n\n\t\t\tif (!vm.designOptionsForm.$valid) {\n\t\t\t\tvm.activeTab = 0;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif (!vm.imageOptionsForm.$valid) {\n\t\t\t\tvm.activeTab = 1;\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tfunction toggleFormDirty(form) {\n\t\t\tangular.forEach(form.$error.required, function(field) {\n\t\t\t\tfield.$setDirty();\n\t\t\t});\n\t\t}\n\n\t\tfunction isDropdownDisabled(item) {\n\t\t\treturn item.isDisabled && item.isDisabled(vm.orderMetadata);\n\t\t}\n\n\t\tfunction updateCropperPosition() {\n\t\t\tvar $cropArea = angular.element('.cropper-crop-box');\n\t\t\tif (!$cropArea.length) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tvar width = $cropArea.width();\n\t\t\tvar height = $cropArea.height();\n\t\t\tvar rollerOffset = 10,\n\t\t\t\tpaddingBottom = 10,\n\t\t\t\tmarginTop = 30,\n\t\t\t\tchainOffset = 50;\n\n\t\t\tvar $cropperContainer = angular.element('.cropper-container');\n\t\t\tvar topOffset = parseInt($cropArea.css('top'));\n\t\t\tvar containerHeight = parseInt($cropperContainer.css('height'));\n\t\t\tvar cropAreaHeight = parseInt($cropArea.css('height'));\n\n\t\t\tvar bottomOffset =\n\t\t\t\tcontainerHeight - cropAreaHeight - topOffset - paddingBottom;\n\t\t\tangular.element('.cropper-wrapper').css({\n\t\t\t\t'margin-top': '-' + topOffset + 'px',\n\t\t\t\t'margin-bottom': '-' + bottomOffset + 'px',\n\t\t\t});\n\t\t\tangular\n\t\t\t\t.element('.replace-padding')\n\t\t\t\t.css({ 'margin-top': topOffset - marginTop, width: width });\n\t\t\tangular\n\t\t\t\t.element('.image-wrapper .roller-wrapper')\n\t\t\t\t.css({ 'margin-top': topOffset, width: width + rollerOffset });\n\t\t\tangular.element('.image-wrapper .chain-wrapper').css({ height: height - chainOffset });\n\t\t}\n\n\t\tfunction createWatchers() {\n\t\t\treturn [].slice.call(arguments).map(function(key) {\n\t\t\t\treturn function() {\n\t\t\t\t\treturn vm.orderMetadata[key];\n\t\t\t\t};\n\t\t\t});\n }\n \n function onKeyUp(e) {\n var escapeKey = 27;\n if (e.keyCode !== escapeKey) {\n return;\n }\n \n $scope.printedPanelsPopup = false;\n $scope.wrappedFinePopup = false;\n $scope.replacePopup = false;\n $scope.$digest();\n }\n\t}\n})();\n\n(function() {\n 'use strict';\n\n angular.module('main', []);\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('main')\n .factory('contactService', ContactService);\n\n function ContactService(API, apiHelperService, $log) {\n return {\n createRequest: createRequest,\n };\n\n function createRequest(data) {\n var req = {\n method: 'POST',\n url: API.CONTACT,\n data: data\n };\n return apiHelperService.sendHTTPRequest(req);\n }\n\n }\n})();\n\n(function() {\n\t'use strict';\n\n\tangular.module('home').factory('cloudConvertService', CloudConvertService);\n\n\tfunction CloudConvertService(API, $http, apiHelperService, fileHelperService, $log) {\n\t\tvar API_KEY =\n\t\t\t'tkDgXB8vWdc3wJ_8CR_RL-d9VVO_G3TZYgzxRHsM0SyyVWNCuk2sjU91p79fMYMDoluE1VxYRhU4hUB7EmoY9w';\n\t\treturn {\n\t\t\tconvertFile: convertFile,\n };\n \n function convertFile(file, extension) {\n var processUrl = '';\n\t\t\treturn createProcessId(extension)\n .then(function(data) {\n processUrl = data.url;\n return start(processUrl);\n })\n .then(function(data) {\n var fd = new FormData();\n fd.append('file', file);\n return upload(data.upload.url, fd);\n })\n .then(function(res) {\n return getStatus(processUrl + '?wait');\n })\n .then(function(data) {\n return download(data.output.url);\n })\n .then(function(res) {\n return fileHelperService.toBlob(res.data);\n });\n }\n\n\t\tfunction createProcessId(inputFormat) {\n\t\t\tvar req = {\n\t\t\t\tmethod: 'POST',\n\t\t\t\turl: 'https://api.cloudconvert.com/process',\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: 'Bearer ' + API_KEY,\n\t\t\t\t},\n\t\t\t\tdata: {\n\t\t\t\t\tinputformat: inputFormat,\n\t\t\t\t\toutputformat: 'png',\n\t\t\t\t},\n\t\t\t};\n\t\t\treturn apiHelperService.sendHTTPRequest(req);\n\t\t}\n\n function getStatus(url) {\n var req = {\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl: url,\n\t\t\t};\n\t\t\treturn apiHelperService.sendHTTPRequest(req);\n }\n\n\t\tfunction start(url) {\n\t\t\tvar req = {\n\t\t\t\tmethod: 'POST',\n\t\t\t\turl: url,\n\t\t\t\tdata: {\n\t\t\t\t\tinput: 'upload',\n\t\t\t\t\toutputformat: 'png',\n\t\t\t\t},\n\t\t\t};\n\t\t\treturn apiHelperService.sendHTTPRequest(req);\n\t\t}\n\n\t\tfunction upload(url, formData) {\n\t\t\treturn $http.post(url, formData, {\n transformRequest: angular.identity,\n headers: {'Content-Type': undefined}\n });\n }\n \n function download(url) {\n return $http.get(url, {\n responseType: 'blob'\n });\n }\n\t}\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('home')\n .factory('businessRules', BusinessRules);\n\n function BusinessRules($log) {\n return {\n execute: execute,\n createWatchers: createWatchers,\n };\n\n function execute(orderMetadata) {\n var rules = getRules();\n rules.forEach(function(rule) {\n if (rule.condition && rule.condition(orderMetadata)) {\n rule.action(orderMetadata);\n }\n });\n }\n\n function createWatchers(vm) {\n var rules = getRules();\n var rulesKeys = rules.map(function(item) {\n return item.fieldKey;\n });\n return rulesKeys.map(function(key) {\n return function() {\n return vm.orderMetadata[key];\n };\n })\n }\n\n function getRules() {\n return [{\n fieldKey: 'fascia',\n condition: function(orderMetadata) { return orderMetadata.fascia !== 'No Fascia'; },\n action: function(orderMetadata) { orderMetadata.rollType = 'Regular Roll'; },\n }, {\n fieldKey: 'motorization',\n condition: function(orderMetadata) { return orderMetadata.motorization !== 'No Motorization'; },\n action: function(orderMetadata) { orderMetadata.controlColor = 'Aluminum'; },\n }]\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('home')\n .factory('orderModalService', orderModalService);\n\n function orderModalService($log, $q, $rootScope, $state, $modal) {\n return {\n show: show,\n hide: hide,\n }\n var orderModal = null;\n\n /////////////////////////\n // OPEN ORDER MODAL\n /////////////////////////\n function show() {\n\n $log.debug(\"order.modal.service: show\");\n\n if (orderModal) {\n $log.debug(\"order.modal.service: instance already exists - multiple requests?\");\n return $q.reject();\n }\n orderModal = $modal({\n templateUrl: 'app/main/home/order-modal/order-modal.view.html',\n controller: 'OrderModalController',\n controllerAs: 'vm',\n backdrop: 'static',\n keyboard: false, // ensure the user cant press escape\n show: false,\n onHide: function() {\n hide();\n }\n });\n return orderModal.$promise.then(orderModal.show);\n }\n\n ////////////////////////////////\n // CLOSE / CANCEL ORDER MODAL\n ////////////////////////////////\n function hide() {\n if (orderModal) {\n $log.debug(\"order.modal.service: hide\");\n orderModal.hide();\n orderModal = null;\n }\n }\n\n }\n})();\n\n\n(function() {\n\t'use strict';\n\n\tangular\n\t\t.module('home')\n\t\t.controller('OrderModalController', OrderModalController);\n\n\tfunction OrderModalController(\n\t\t$scope,\n\t\t$state,\n\t\t$timeout,\n\t\t$log,\n\t\tcartService,\n\t\tformsService,\n\t\torderModalService,\n\t\tflashService\n\t) {\n\t\tvar vm = this;\n\n\t\tvm.closeModal = closeModal;\n vm.getMotorization = getMotorization;\n \n\t\tvm.progress = null;\n\t\tvm.progressData = {};\n\t\tvm.isProcessed = true;\n vm.isSuccessful = false;\n\n\t\t$scope.$on('orderStateChange', handleOrderStateChange);\n\t\t$scope.$on('orderProgressChange', handleOrderProgressChange);\n \n\t\t(function init() {\n vm.orderMetadata = cartService.getOrderMetadata();\n\t\t})();\n\n\t\tfunction closeModal() {\n\t\t\torderModalService.hide();\n\t\t}\n\n\t\tfunction handleOrderStateChange(event, isSuccessful) {\n\t\t\tvm.isProcessed = false;\n\t\t\tvm.isSuccessful = isSuccessful;\n\t\t\tvm.progress = null;\n\t\t\tvm.progressData = {};\n\t\t}\n\n\t\tfunction handleOrderProgressChange(event, obj) {\n\t\t\tvm.progressData[obj.index] = obj.value;\n\t\t\tvm.progress = (vm.progressData[0] + vm.progressData[1]) / 2;\n }\n \n function getMotorization() {\n\t\t\treturn vm.orderMetadata.motorization === 'None'\n\t\t\t\t? 'No Motorization'\n\t\t\t\t: vm.orderMetadata.motorization;\n }\n\t}\n})();\n\n(function() {\n\t'use strict';\n\n\tangular.module('home').factory('modalService', modalService);\n\n\tfunction modalService($log, $q, $rootScope, $state, $modal) {\n\t\treturn {\n\t\t\tshow: show,\n\t\t\thide: hide,\n };\n \n var modalRef = null;\n\n\t\tfunction show(templateFilename) {\n if (!templateFilename) {\n return $q.reject();;\n }\n \n\t\t\t$log.debug('modal.service: show');\n\n\t\t\tif (modalRef) {\n\t\t\t\t$log.debug(\n\t\t\t\t\t'help.modal.service: instance already exists - multiple requests?'\n\t\t\t\t);\n\t\t\t\treturn $q.reject();\n\t\t\t}\n\t\t\tmodalRef = $modal({\n\t\t\t\ttemplateUrl: 'app/main/home/modals/views/' + templateFilename + '.html',\n\t\t\t\tcontroller: 'ModalController',\n\t\t\t\tcontrollerAs: 'vm',\n\t\t\t\tbackdrop: 'static',\n\t\t\t\tkeyboard: false, // ensure the user cant press escape\n\t\t\t\tshow: false,\n\t\t\t\tonHide: function() {\n\t\t\t\t\thide();\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn modalRef.$promise.then(modalRef.show);\n }\n \n\t\tfunction hide() {\n\t\t\tif (!modalRef) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$log.debug('help.modal.service: hide');\n\t\t\tmodalRef.hide();\n\t\t\tmodalRef = null;\n\t\t}\n\t}\n})();\n\n(function() {\n\t'use strict';\n\n\tangular.module('home').controller('ModalController', ModalController);\n\n\tfunction ModalController($scope, $log, formsService, contactService, $document, modalService) {\n\t\tvar vm = this;\n\n vm.form = {};\n vm.isSubmitButtonHidden = false;\n\n vm.closeModal = closeModal;\n vm.submitForm = submitForm;\n\n (function init() {\n $document.on('keyup', onKeyUp);\n })();\n\n function onKeyUp(e) {\n var escapeKey = 27;\n if (e.keyCode && e.keyCode === escapeKey) {\n closeModal();\n }\n }\n\n\t\tfunction closeModal() {\n modalService.hide();\n $document.off('keyup', onKeyUp);\n }\n \n function submitForm() {\n if (!vm.contactForm.$valid) {\n return;\n }\n vm.isSubmitButtonHidden = true;\n contactService.createRequest({\n phone: vm.form.phoneNumber,\n })\n .then(function(res) {\n $log.debug('customizable-popup', res);\n })\n .catch(function(err) {\n $log.error('customizable-popup', err);\n });\n }\n\t}\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.services.utility', []);\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.services.utility')\n .factory('selectHelperService', selectHelperService);\n\n function selectHelperService() {\n var self = this;\n return {\n pickValue: pickValue,\n parse: parse,\n };\n\n function parse(value) {\n if (!value || typeof value !== 'string') {\n return value;\n }\n return value.toLowerCase().split(' ').join('_');\n }\n \n function pickValue(options) {\n return options && options[0] ? options[0] : null;\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.services.utility')\n .factory('overflowSubjectService', overflowSubjectService);\n\n function overflowSubjectService() {\n var self = this;\n self.observers = [];\n\n return {\n subscribe: subscribe,\n next: next\n };\n\n function next(value) {\n self.observers.forEach(function(observer) {\n observer(value);\n });\n }\n\n function subscribe(observer) {\n self.observers.push(observer);\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.services.utility')\n .factory('formsService', formsService);\n\n function formsService($log) {\n var form = {};\n\n form.hasError = function(ngModelCtrl) {\n return ngModelCtrl.$dirty && ngModelCtrl.$invalid;\n };\n form.showError = function(ngModelCtrl, err) {\n return ngModelCtrl.$dirty && ngModelCtrl.$error[err];\n };\n form.canSave = function(ngFormCtrl) {\n return ngFormCtrl.$dirty && ngFormCtrl.$valid;\n };\n\n return form;\n }\n\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.services.utility')\n .factory('flashService', flashService);\n\n function flashService($log, $rootScope) {\n\n var service = {};\n\n service.success = success;\n service.error = error;\n service.info = info;\n service.warning = warning;\n\n initService();\n\n return service;\n\n function initService() {\n \n $rootScope.$on('$stateChangeStart', function () {\n //$log.debug(\"clearFlashMessage\");\n clearFlashMessage();\n });\n\n function clearFlashMessage() {\n var flash = $rootScope.flash;\n if (flash) {\n if (!flash.keepAfterLocationChange) {\n delete $rootScope.flash;\n } else {\n // only keep for a single location change\n flash.keepAfterLocationChange = false;\n }\n }\n }\n }\n\n\n function success(message, keepAfterLocationChange) {\n\n $rootScope.isDataLoading = false;\n\n $rootScope.flash = {\n message: message,\n type: 'success',\n keepAfterLocationChange: keepAfterLocationChange\n };\n }\n\n function error(message, keepAfterLocationChange) {\n\n $rootScope.isDataLoading = false;\n\n $rootScope.flash = {\n message: message,\n type: 'danger',\n keepAfterLocationChange: keepAfterLocationChange\n };\n }\n\n function info(message, keepAfterLocationChange) {\n\n $rootScope.isDataLoading = false;\n\n $rootScope.flash = {\n message: message,\n type: 'info',\n keepAfterLocationChange: keepAfterLocationChange\n };\n }\n\n function warning(message, keepAfterLocationChange) {\n\n $rootScope.isDataLoading = false;\n\n $rootScope.flash = {\n message: message,\n type: 'warning',\n keepAfterLocationChange: keepAfterLocationChange\n };\n }\n }\n\n})();\n\n// This Service is used for Global Event Broadcasting\n(function() {\n 'use strict';\n\n angular\n .module('app.services.utility')\n .factory('fileHelperService', fileHelperService);\n\n function fileHelperService(AWS_S3_UPLOAD, Upload, $log, $rootScope) {\n var self = this;\n\n return {\n toBlob: toBlob,\n uploadImage: uploadImage,\n dataURItoBlob: dataURItoBlob,\n getFileExtension: getFileExtension,\n };\n\n function toBlob(file) {\n var reader = new FileReader();\n return new Promise(function(resolve, reject) {\n if (!file) return;\n \n reader.onload = function(evt) {\n resolve(evt.target.result);\n };\n try {\n reader.readAsDataURL(file);\n }\n catch (e) {\n reject(e);\n }\n });\n }\n\n function uploadImage(blob, index) {\n var fileExtension = 'png';\n var cleanedFilename = cleanFilename(String(new Date().getTime()));\n var cleanedFilenameAndExtension = cleanedFilename + \".\" + fileExtension;\n\n var file = new Blob([blob], { type: 'image/png' });\n return Upload.upload({\n url: AWS_S3_UPLOAD.s3url,\n method: 'POST',\n data: {\n key: cleanedFilename + \".\" + fileExtension, // the key to store the file on S3, could be file name or customized\n AWSAccessKeyId: AWS_S3_UPLOAD.AWSAccessKeyId,\n acl: 'public-read', // sets the access to the uploaded file in the bucket: private, public-read, ...\n policy: AWS_S3_UPLOAD.policy,\n signature: AWS_S3_UPLOAD.signature, // base64-encoded signature based on policy string (see article below)\n \"Content-Type\": 'application/octet-stream', // content type of the file (NotEmpty)\n filename: cleanedFilenameAndExtension,\n file: file\n },\n headers: { \n 'Authorization': undefined // we dont want to send auth: bearer JWT for s3 uploads\n }\n }).then(\n function(response) { return response.config.url + response.config.data.filename; }, null,\n function(evt) {\n var progressPercentage = parseInt(100.0 * evt.loaded / evt.total);\n $rootScope.$broadcast('orderProgressChange', { index: index, value: progressPercentage });\n $log.debug('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);\n }\n );\n }\n\n function cleanFilename(inputString) {\n var timestamp = Date.now();\n var outputString = inputString.replace(/([~!@#$%^&*()_+=`{}\\[\\]\\|\\\\:;'<>,.\\/? ])+/g, '-').replace(/^(-)+|(-)+$/g,'');\n var outputStringWithTimestamp = outputString+'-'+timestamp;\n $log.debug(\"cleanedFilename-outputStringWithTimestamp\", outputStringWithTimestamp);\n return outputStringWithTimestamp;\n }\n\n function getFileExtension(filename) {\n var re = /(?:\\.([^.]+))?$/;\n return re.exec(filename)[1]; \n }\n\n function dataURItoBlob(dataURI) {\n var byteString = atob(dataURI.split(',')[1]);\n var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]\n\n var ab = new ArrayBuffer(byteString.length);\n var ia = new Uint8Array(ab);\n for (var i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n\n var blob = new Blob([ab], {type: mimeString});\n return blob;\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.services.utility')\n .factory('apiHelperService', apiHelperService);\n\n function apiHelperService($log, $http, ENV_VARS) {\n\n return {\n sendHTTPRequest: sendHTTPRequest\n };\n\n function sendHTTPRequest(req) {\n\n //$log.debug(\"apiHelperService: sendHTTPRequest()\");\n\n if(req.method === \"GET\" && ENV_VARS && ENV_VARS.s3BucketDomain && ENV_VARS.cdnDomain) {\n req.url.replace(ENV_VARS.s3BucketDomain, ENV_VARS.cdnDomain);\n }\n\n return $http(req).then(function(response) {\n // success\n //$log.debug(\"apiHelperService-success\", response);\n return response.data;\n\n }, function(error) {\n // error\n $log.error(\"apiHelperService-error:\", error.status + \": \" + error.statusText);\n throw error.data;\n });\n };\n\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.services.utility')\n .factory('panelService', panelService);\n\n function panelService($aside, $state, $stateParams, $log, $q) {\n\n return {\n show: show,\n hide: hide\n }\n\n var aside = null;\n\n /////////////////////////\n // SHOW PANEL (ASIDE)\n /////////////////////////\n function show(template, controller) {\n\n //$log.debug(\"panel.service: show\");\n\n aside = $aside({\n templateUrl: template,\n controller: controller,\n controllerAs: 'vm',\n container: 'body',\n placement: 'right',\n keyboard: true,\n animation: 'am-slide-right',\n show: false,\n onHide: function() {\n hide();\n }\n });\n\n return aside.$promise.then(aside.show); \n \n }\n\n /////////////////////////\n // CLOSE PANEL (ASIDE)\n /////////////////////////\n function hide() {\n\n if (aside) {\n //$log.debug(\"panel.service: hide\");\n //aside = null;\n //aside.$promise.then(aside.destroy);\n aside.destroy();\n //aside.hide;\n //$state.go(\"home\");\n }\n\n \n \n } \n \n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular.module('app.services.utility')\n .factory('debounce', debounce);\n\n function debounce($timeout, $q) {\n return function debounce(func, wait, immediate) {\n var timeout;\n var deferred = $q.defer();\n return function() {\n var context = this,\n args = arguments;\n var later = function() {\n timeout = null;\n if (!immediate) {\n deferred.resolve(func.apply(context, args));\n deferred = $q.defer();\n }\n };\n var callNow = immediate && !timeout;\n if (timeout) {\n $timeout.cancel(timeout);\n }\n timeout = $timeout(later, wait);\n if (callNow) {\n deferred.resolve(func.apply(context, args));\n deferred = $q.defer();\n }\n return deferred.promise;\n };\n };\n }\n})();\n\n(function() {\n 'use strict';\n\n angular.module('checkout', []);\n\n})();\n\n(function() {\n\t'use strict';\n\n\tangular.module('checkout').factory('statesService', StatesService);\n\n\tfunction StatesService() {\n\t\treturn {\n\t\t\tgetAll: getAll,\n\t\t};\n\n\t\tfunction getAll() {\n\t\t\treturn [\n\t\t\t\t{\n\t\t\t\t\tname: 'Alabama',\n\t\t\t\t\tabbreviation: 'AL',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Alaska',\n\t\t\t\t\tabbreviation: 'AK',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'American Samoa',\n\t\t\t\t\tabbreviation: 'AS',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Arizona',\n\t\t\t\t\tabbreviation: 'AZ',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Arkansas',\n\t\t\t\t\tabbreviation: 'AR',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'California',\n\t\t\t\t\tabbreviation: 'CA',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Colorado',\n\t\t\t\t\tabbreviation: 'CO',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Connecticut',\n\t\t\t\t\tabbreviation: 'CT',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Delaware',\n\t\t\t\t\tabbreviation: 'DE',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'District Of Columbia',\n\t\t\t\t\tabbreviation: 'DC',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Federated States Of Micronesia',\n\t\t\t\t\tabbreviation: 'FM',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Florida',\n\t\t\t\t\tabbreviation: 'FL',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Georgia',\n\t\t\t\t\tabbreviation: 'GA',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Guam',\n\t\t\t\t\tabbreviation: 'GU',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Hawaii',\n\t\t\t\t\tabbreviation: 'HI',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Idaho',\n\t\t\t\t\tabbreviation: 'ID',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Illinois',\n\t\t\t\t\tabbreviation: 'IL',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Indiana',\n\t\t\t\t\tabbreviation: 'IN',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Iowa',\n\t\t\t\t\tabbreviation: 'IA',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Kansas',\n\t\t\t\t\tabbreviation: 'KS',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Kentucky',\n\t\t\t\t\tabbreviation: 'KY',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Louisiana',\n\t\t\t\t\tabbreviation: 'LA',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Maine',\n\t\t\t\t\tabbreviation: 'ME',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Marshall Islands',\n\t\t\t\t\tabbreviation: 'MH',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Maryland',\n\t\t\t\t\tabbreviation: 'MD',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Massachusetts',\n\t\t\t\t\tabbreviation: 'MA',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Michigan',\n\t\t\t\t\tabbreviation: 'MI',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Minnesota',\n\t\t\t\t\tabbreviation: 'MN',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Mississippi',\n\t\t\t\t\tabbreviation: 'MS',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Missouri',\n\t\t\t\t\tabbreviation: 'MO',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Montana',\n\t\t\t\t\tabbreviation: 'MT',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Nebraska',\n\t\t\t\t\tabbreviation: 'NE',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Nevada',\n\t\t\t\t\tabbreviation: 'NV',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'New Hampshire',\n\t\t\t\t\tabbreviation: 'NH',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'New Jersey',\n\t\t\t\t\tabbreviation: 'NJ',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'New Mexico',\n\t\t\t\t\tabbreviation: 'NM',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'New York',\n\t\t\t\t\tabbreviation: 'NY',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'North Carolina',\n\t\t\t\t\tabbreviation: 'NC',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'North Dakota',\n\t\t\t\t\tabbreviation: 'ND',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Northern Mariana Islands',\n\t\t\t\t\tabbreviation: 'MP',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Ohio',\n\t\t\t\t\tabbreviation: 'OH',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Oklahoma',\n\t\t\t\t\tabbreviation: 'OK',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Oregon',\n\t\t\t\t\tabbreviation: 'OR',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Palau',\n\t\t\t\t\tabbreviation: 'PW',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Pennsylvania',\n\t\t\t\t\tabbreviation: 'PA',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Puerto Rico',\n\t\t\t\t\tabbreviation: 'PR',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Rhode Island',\n\t\t\t\t\tabbreviation: 'RI',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'South Carolina',\n\t\t\t\t\tabbreviation: 'SC',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'South Dakota',\n\t\t\t\t\tabbreviation: 'SD',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Tennessee',\n\t\t\t\t\tabbreviation: 'TN',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Texas',\n\t\t\t\t\tabbreviation: 'TX',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Utah',\n\t\t\t\t\tabbreviation: 'UT',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Vermont',\n\t\t\t\t\tabbreviation: 'VT',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Virgin Islands',\n\t\t\t\t\tabbreviation: 'VI',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Virginia',\n\t\t\t\t\tabbreviation: 'VA',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Washington',\n\t\t\t\t\tabbreviation: 'WA',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'West Virginia',\n\t\t\t\t\tabbreviation: 'WV',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Wisconsin',\n\t\t\t\t\tabbreviation: 'WI',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tname: 'Wyoming',\n\t\t\t\t\tabbreviation: 'WY',\n\t\t\t\t},\n\t\t\t];\n\t\t}\n\t}\n})();\n\n(function() {\n\t'use strict';\n\n\tangular.module('checkout').factory('countriesService', CountriesService);\n\n\tfunction CountriesService() {\n\t\treturn {\n\t\t\tgetAll: getAll,\n\t\t};\n\n\t\tfunction getAll() {\n\t\t\treturn [\n\t\t\t\t{ name: 'Afghanistan', code: 'AF' },\n\t\t\t\t{ name: 'Åland Islands', code: 'AX' },\n\t\t\t\t{ name: 'Albania', code: 'AL' },\n\t\t\t\t{ name: 'Algeria', code: 'DZ' },\n\t\t\t\t{ name: 'American Samoa', code: 'AS' },\n\t\t\t\t{ name: 'AndorrA', code: 'AD' },\n\t\t\t\t{ name: 'Angola', code: 'AO' },\n\t\t\t\t{ name: 'Anguilla', code: 'AI' },\n\t\t\t\t{ name: 'Antarctica', code: 'AQ' },\n\t\t\t\t{ name: 'Antigua and Barbuda', code: 'AG' },\n\t\t\t\t{ name: 'Argentina', code: 'AR' },\n\t\t\t\t{ name: 'Armenia', code: 'AM' },\n\t\t\t\t{ name: 'Aruba', code: 'AW' },\n\t\t\t\t{ name: 'Australia', code: 'AU' },\n\t\t\t\t{ name: 'Austria', code: 'AT' },\n\t\t\t\t{ name: 'Azerbaijan', code: 'AZ' },\n\t\t\t\t{ name: 'Bahamas', code: 'BS' },\n\t\t\t\t{ name: 'Bahrain', code: 'BH' },\n\t\t\t\t{ name: 'Bangladesh', code: 'BD' },\n\t\t\t\t{ name: 'Barbados', code: 'BB' },\n\t\t\t\t{ name: 'Belarus', code: 'BY' },\n\t\t\t\t{ name: 'Belgium', code: 'BE' },\n\t\t\t\t{ name: 'Belize', code: 'BZ' },\n\t\t\t\t{ name: 'Benin', code: 'BJ' },\n\t\t\t\t{ name: 'Bermuda', code: 'BM' },\n\t\t\t\t{ name: 'Bhutan', code: 'BT' },\n\t\t\t\t{ name: 'Bolivia', code: 'BO' },\n\t\t\t\t{ name: 'Bosnia and Herzegovina', code: 'BA' },\n\t\t\t\t{ name: 'Botswana', code: 'BW' },\n\t\t\t\t{ name: 'Bouvet Island', code: 'BV' },\n\t\t\t\t{ name: 'Brazil', code: 'BR' },\n\t\t\t\t{ name: 'British Indian Ocean Territory', code: 'IO' },\n\t\t\t\t{ name: 'Brunei Darussalam', code: 'BN' },\n\t\t\t\t{ name: 'Bulgaria', code: 'BG' },\n\t\t\t\t{ name: 'Burkina Faso', code: 'BF' },\n\t\t\t\t{ name: 'Burundi', code: 'BI' },\n\t\t\t\t{ name: 'Cambodia', code: 'KH' },\n\t\t\t\t{ name: 'Cameroon', code: 'CM' },\n\t\t\t\t{ name: 'Canada', code: 'CA' },\n\t\t\t\t{ name: 'Cape Verde', code: 'CV' },\n\t\t\t\t{ name: 'Cayman Islands', code: 'KY' },\n\t\t\t\t{ name: 'Central African Republic', code: 'CF' },\n\t\t\t\t{ name: 'Chad', code: 'TD' },\n\t\t\t\t{ name: 'Chile', code: 'CL' },\n\t\t\t\t{ name: 'China', code: 'CN' },\n\t\t\t\t{ name: 'Christmas Island', code: 'CX' },\n\t\t\t\t{ name: 'Cocos (Keeling) Islands', code: 'CC' },\n\t\t\t\t{ name: 'Colombia', code: 'CO' },\n\t\t\t\t{ name: 'Comoros', code: 'KM' },\n\t\t\t\t{ name: 'Congo', code: 'CG' },\n\t\t\t\t{ name: 'Congo, The Democratic Republic of the', code: 'CD' },\n\t\t\t\t{ name: 'Cook Islands', code: 'CK' },\n\t\t\t\t{ name: 'Costa Rica', code: 'CR' },\n\t\t\t\t{ name: \"Cote D'Ivoire\", code: 'CI' },\n\t\t\t\t{ name: 'Croatia', code: 'HR' },\n\t\t\t\t{ name: 'Cuba', code: 'CU' },\n\t\t\t\t{ name: 'Cyprus', code: 'CY' },\n\t\t\t\t{ name: 'Czech Republic', code: 'CZ' },\n\t\t\t\t{ name: 'Denmark', code: 'DK' },\n\t\t\t\t{ name: 'Djibouti', code: 'DJ' },\n\t\t\t\t{ name: 'Dominica', code: 'DM' },\n\t\t\t\t{ name: 'Dominican Republic', code: 'DO' },\n\t\t\t\t{ name: 'Ecuador', code: 'EC' },\n\t\t\t\t{ name: 'Egypt', code: 'EG' },\n\t\t\t\t{ name: 'El Salvador', code: 'SV' },\n\t\t\t\t{ name: 'Equatorial Guinea', code: 'GQ' },\n\t\t\t\t{ name: 'Eritrea', code: 'ER' },\n\t\t\t\t{ name: 'Estonia', code: 'EE' },\n\t\t\t\t{ name: 'Ethiopia', code: 'ET' },\n\t\t\t\t{ name: 'Falkland Islands (Malvinas)', code: 'FK' },\n\t\t\t\t{ name: 'Faroe Islands', code: 'FO' },\n\t\t\t\t{ name: 'Fiji', code: 'FJ' },\n\t\t\t\t{ name: 'Finland', code: 'FI' },\n\t\t\t\t{ name: 'France', code: 'FR' },\n\t\t\t\t{ name: 'French Guiana', code: 'GF' },\n\t\t\t\t{ name: 'French Polynesia', code: 'PF' },\n\t\t\t\t{ name: 'French Southern Territories', code: 'TF' },\n\t\t\t\t{ name: 'Gabon', code: 'GA' },\n\t\t\t\t{ name: 'Gambia', code: 'GM' },\n\t\t\t\t{ name: 'Georgia', code: 'GE' },\n\t\t\t\t{ name: 'Germany', code: 'DE' },\n\t\t\t\t{ name: 'Ghana', code: 'GH' },\n\t\t\t\t{ name: 'Gibraltar', code: 'GI' },\n\t\t\t\t{ name: 'Greece', code: 'GR' },\n\t\t\t\t{ name: 'Greenland', code: 'GL' },\n\t\t\t\t{ name: 'Grenada', code: 'GD' },\n\t\t\t\t{ name: 'Guadeloupe', code: 'GP' },\n\t\t\t\t{ name: 'Guam', code: 'GU' },\n\t\t\t\t{ name: 'Guatemala', code: 'GT' },\n\t\t\t\t{ name: 'Guernsey', code: 'GG' },\n\t\t\t\t{ name: 'Guinea', code: 'GN' },\n\t\t\t\t{ name: 'Guinea-Bissau', code: 'GW' },\n\t\t\t\t{ name: 'Guyana', code: 'GY' },\n\t\t\t\t{ name: 'Haiti', code: 'HT' },\n\t\t\t\t{ name: 'Heard Island and Mcdonald Islands', code: 'HM' },\n\t\t\t\t{ name: 'Holy See (Vatican City State)', code: 'VA' },\n\t\t\t\t{ name: 'Honduras', code: 'HN' },\n\t\t\t\t{ name: 'Hong Kong', code: 'HK' },\n\t\t\t\t{ name: 'Hungary', code: 'HU' },\n\t\t\t\t{ name: 'Iceland', code: 'IS' },\n\t\t\t\t{ name: 'India', code: 'IN' },\n\t\t\t\t{ name: 'Indonesia', code: 'ID' },\n\t\t\t\t{ name: 'Iran, Islamic Republic Of', code: 'IR' },\n\t\t\t\t{ name: 'Iraq', code: 'IQ' },\n\t\t\t\t{ name: 'Ireland', code: 'IE' },\n\t\t\t\t{ name: 'Isle of Man', code: 'IM' },\n\t\t\t\t{ name: 'Israel', code: 'IL' },\n\t\t\t\t{ name: 'Italy', code: 'IT' },\n\t\t\t\t{ name: 'Jamaica', code: 'JM' },\n\t\t\t\t{ name: 'Japan', code: 'JP' },\n\t\t\t\t{ name: 'Jersey', code: 'JE' },\n\t\t\t\t{ name: 'Jordan', code: 'JO' },\n\t\t\t\t{ name: 'Kazakhstan', code: 'KZ' },\n\t\t\t\t{ name: 'Kenya', code: 'KE' },\n\t\t\t\t{ name: 'Kiribati', code: 'KI' },\n\t\t\t\t{ name: \"Korea, Democratic People'S Republic of\", code: 'KP' },\n\t\t\t\t{ name: 'Korea, Republic of', code: 'KR' },\n\t\t\t\t{ name: 'Kuwait', code: 'KW' },\n\t\t\t\t{ name: 'Kyrgyzstan', code: 'KG' },\n\t\t\t\t{ name: \"Lao People'S Democratic Republic\", code: 'LA' },\n\t\t\t\t{ name: 'Latvia', code: 'LV' },\n\t\t\t\t{ name: 'Lebanon', code: 'LB' },\n\t\t\t\t{ name: 'Lesotho', code: 'LS' },\n\t\t\t\t{ name: 'Liberia', code: 'LR' },\n\t\t\t\t{ name: 'Libyan Arab Jamahiriya', code: 'LY' },\n\t\t\t\t{ name: 'Liechtenstein', code: 'LI' },\n\t\t\t\t{ name: 'Lithuania', code: 'LT' },\n\t\t\t\t{ name: 'Luxembourg', code: 'LU' },\n\t\t\t\t{ name: 'Macao', code: 'MO' },\n\t\t\t\t{ name: 'Macedonia, The Former Yugoslav Republic of', code: 'MK' },\n\t\t\t\t{ name: 'Madagascar', code: 'MG' },\n\t\t\t\t{ name: 'Malawi', code: 'MW' },\n\t\t\t\t{ name: 'Malaysia', code: 'MY' },\n\t\t\t\t{ name: 'Maldives', code: 'MV' },\n\t\t\t\t{ name: 'Mali', code: 'ML' },\n\t\t\t\t{ name: 'Malta', code: 'MT' },\n\t\t\t\t{ name: 'Marshall Islands', code: 'MH' },\n\t\t\t\t{ name: 'Martinique', code: 'MQ' },\n\t\t\t\t{ name: 'Mauritania', code: 'MR' },\n\t\t\t\t{ name: 'Mauritius', code: 'MU' },\n\t\t\t\t{ name: 'Mayotte', code: 'YT' },\n\t\t\t\t{ name: 'Mexico', code: 'MX' },\n\t\t\t\t{ name: 'Micronesia, Federated States of', code: 'FM' },\n\t\t\t\t{ name: 'Moldova, Republic of', code: 'MD' },\n\t\t\t\t{ name: 'Monaco', code: 'MC' },\n\t\t\t\t{ name: 'Mongolia', code: 'MN' },\n\t\t\t\t{ name: 'Montserrat', code: 'MS' },\n\t\t\t\t{ name: 'Morocco', code: 'MA' },\n\t\t\t\t{ name: 'Mozambique', code: 'MZ' },\n\t\t\t\t{ name: 'Myanmar', code: 'MM' },\n\t\t\t\t{ name: 'Namibia', code: 'NA' },\n\t\t\t\t{ name: 'Nauru', code: 'NR' },\n\t\t\t\t{ name: 'Nepal', code: 'NP' },\n\t\t\t\t{ name: 'Netherlands', code: 'NL' },\n\t\t\t\t{ name: 'Netherlands Antilles', code: 'AN' },\n\t\t\t\t{ name: 'New Caledonia', code: 'NC' },\n\t\t\t\t{ name: 'New Zealand', code: 'NZ' },\n\t\t\t\t{ name: 'Nicaragua', code: 'NI' },\n\t\t\t\t{ name: 'Niger', code: 'NE' },\n\t\t\t\t{ name: 'Nigeria', code: 'NG' },\n\t\t\t\t{ name: 'Niue', code: 'NU' },\n\t\t\t\t{ name: 'Norfolk Island', code: 'NF' },\n\t\t\t\t{ name: 'Northern Mariana Islands', code: 'MP' },\n\t\t\t\t{ name: 'Norway', code: 'NO' },\n\t\t\t\t{ name: 'Oman', code: 'OM' },\n\t\t\t\t{ name: 'Pakistan', code: 'PK' },\n\t\t\t\t{ name: 'Palau', code: 'PW' },\n\t\t\t\t{ name: 'Palestinian Territory, Occupied', code: 'PS' },\n\t\t\t\t{ name: 'Panama', code: 'PA' },\n\t\t\t\t{ name: 'Papua New Guinea', code: 'PG' },\n\t\t\t\t{ name: 'Paraguay', code: 'PY' },\n\t\t\t\t{ name: 'Peru', code: 'PE' },\n\t\t\t\t{ name: 'Philippines', code: 'PH' },\n\t\t\t\t{ name: 'Pitcairn', code: 'PN' },\n\t\t\t\t{ name: 'Poland', code: 'PL' },\n\t\t\t\t{ name: 'Portugal', code: 'PT' },\n\t\t\t\t{ name: 'Puerto Rico', code: 'PR' },\n\t\t\t\t{ name: 'Qatar', code: 'QA' },\n\t\t\t\t{ name: 'Reunion', code: 'RE' },\n\t\t\t\t{ name: 'Romania', code: 'RO' },\n\t\t\t\t{ name: 'Russian Federation', code: 'RU' },\n\t\t\t\t{ name: 'Rwanda', code: 'RW' },\n\t\t\t\t{ name: 'Saint Helena', code: 'SH' },\n\t\t\t\t{ name: 'Saint Kitts and Nevis', code: 'KN' },\n\t\t\t\t{ name: 'Saint Lucia', code: 'LC' },\n\t\t\t\t{ name: 'Saint Pierre and Miquelon', code: 'PM' },\n\t\t\t\t{ name: 'Saint Vincent and the Grenadines', code: 'VC' },\n\t\t\t\t{ name: 'Samoa', code: 'WS' },\n\t\t\t\t{ name: 'San Marino', code: 'SM' },\n\t\t\t\t{ name: 'Sao Tome and Principe', code: 'ST' },\n\t\t\t\t{ name: 'Saudi Arabia', code: 'SA' },\n\t\t\t\t{ name: 'Senegal', code: 'SN' },\n\t\t\t\t{ name: 'Serbia and Montenegro', code: 'CS' },\n\t\t\t\t{ name: 'Seychelles', code: 'SC' },\n\t\t\t\t{ name: 'Sierra Leone', code: 'SL' },\n\t\t\t\t{ name: 'Singapore', code: 'SG' },\n\t\t\t\t{ name: 'Slovakia', code: 'SK' },\n\t\t\t\t{ name: 'Slovenia', code: 'SI' },\n\t\t\t\t{ name: 'Solomon Islands', code: 'SB' },\n\t\t\t\t{ name: 'Somalia', code: 'SO' },\n\t\t\t\t{ name: 'South Africa', code: 'ZA' },\n\t\t\t\t{ name: 'South Georgia and the South Sandwich Islands', code: 'GS' },\n\t\t\t\t{ name: 'Spain', code: 'ES' },\n\t\t\t\t{ name: 'Sri Lanka', code: 'LK' },\n\t\t\t\t{ name: 'Sudan', code: 'SD' },\n\t\t\t\t{ name: 'Suriname', code: 'SR' },\n\t\t\t\t{ name: 'Svalbard and Jan Mayen', code: 'SJ' },\n\t\t\t\t{ name: 'Swaziland', code: 'SZ' },\n\t\t\t\t{ name: 'Sweden', code: 'SE' },\n\t\t\t\t{ name: 'Switzerland', code: 'CH' },\n\t\t\t\t{ name: 'Syrian Arab Republic', code: 'SY' },\n\t\t\t\t{ name: 'Taiwan, Province of China', code: 'TW' },\n\t\t\t\t{ name: 'Tajikistan', code: 'TJ' },\n\t\t\t\t{ name: 'Tanzania, United Republic of', code: 'TZ' },\n\t\t\t\t{ name: 'Thailand', code: 'TH' },\n\t\t\t\t{ name: 'Timor-Leste', code: 'TL' },\n\t\t\t\t{ name: 'Togo', code: 'TG' },\n\t\t\t\t{ name: 'Tokelau', code: 'TK' },\n\t\t\t\t{ name: 'Tonga', code: 'TO' },\n\t\t\t\t{ name: 'Trinidad and Tobago', code: 'TT' },\n\t\t\t\t{ name: 'Tunisia', code: 'TN' },\n\t\t\t\t{ name: 'Turkey', code: 'TR' },\n\t\t\t\t{ name: 'Turkmenistan', code: 'TM' },\n\t\t\t\t{ name: 'Turks and Caicos Islands', code: 'TC' },\n\t\t\t\t{ name: 'Tuvalu', code: 'TV' },\n\t\t\t\t{ name: 'Uganda', code: 'UG' },\n\t\t\t\t{ name: 'Ukraine', code: 'UA' },\n\t\t\t\t{ name: 'United Arab Emirates', code: 'AE' },\n\t\t\t\t{ name: 'United Kingdom', code: 'GB' },\n\t\t\t\t{ name: 'United States', code: 'US' },\n\t\t\t\t{ name: 'United States Minor Outlying Islands', code: 'UM' },\n\t\t\t\t{ name: 'Uruguay', code: 'UY' },\n\t\t\t\t{ name: 'Uzbekistan', code: 'UZ' },\n\t\t\t\t{ name: 'Vanuatu', code: 'VU' },\n\t\t\t\t{ name: 'Venezuela', code: 'VE' },\n\t\t\t\t{ name: 'Viet Nam', code: 'VN' },\n\t\t\t\t{ name: 'Virgin Islands, British', code: 'VG' },\n\t\t\t\t{ name: 'Virgin Islands, U.S.', code: 'VI' },\n\t\t\t\t{ name: 'Wallis and Futuna', code: 'WF' },\n\t\t\t\t{ name: 'Western Sahara', code: 'EH' },\n\t\t\t\t{ name: 'Yemen', code: 'YE' },\n\t\t\t\t{ name: 'Zambia', code: 'ZM' },\n\t\t\t\t{ name: 'Zimbabwe', code: 'ZW' },\n\t\t\t];\n\t\t}\n\t}\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('home')\n .directive('cropper', CropperDirective);\n\n function CropperDirective(orderHelperService, $rootScope) {\n return {\n restrict: 'A',\n scope: {\n scale: '=',\n width: '<',\n height: '<',\n options: '=',\n cropBoxData: '=',\n onReady: '&',\n },\n link: function(scope, element, attrs) {\n var self = this;\n var readyListener = null, moveListener = null;\n var zoomRatioOffset = 0;\n \n element.bind('load', function() {\n cleanup();\n init();\n });\n element.on('$destroy', cleanup);\n $rootScope.$on('cropBoxDataUpdate', function(ev, data) {\n self.cachedCropBoxData = data;\n });\n\n function cleanup() {\n self.cropper && self.cropper.destroy();\n\n readyListener && element.context.removeEventListener('ready', readyListener);\n moveListener && element.context.removeEventListener('cropmove', moveListener);\n readyListener = null;\n moveListener = null;\n }\n\n function init() {\n var image = element.context;\n self.cropper = new Cropper(image, {\n guides: false,\n zoomOnTouch: false,\n zoomOnWheel: false,\n cropBoxResizable: false,\n autoCropArea: 1,\n aspectRatio: 1,\n minCropBoxWidth: 1000,\n dragMode: 'none'\n });\n\n readyListener = image.addEventListener('ready', function() {\n handleScaleChange(scope.scale);\n handleRatioChanged();\n\n self.cachedCropBoxData && self.cropper.setCropBoxData(self.cachedCropBoxData);\n moveListener = image.addEventListener('cropmove', handleCropMove);\n \n var canvasData = self.cropper.getCanvasData();\n var cropBoxData = self.cropper.getCropBoxData();\n var widthRatio = cropBoxData.width / canvasData.width;\n var heightRatio = cropBoxData.height / canvasData.height;\n var dimensionsRatio = widthRatio > heightRatio ? widthRatio : heightRatio;\n // console.warn('canvas',canvasData);\n // console.warn('cropBox',cropBoxData);\n // console.warn(dimensionsRatio, widthRatio, heightRatio);\n \n zoomRatioOffset = 1 - dimensionsRatio;\n self.cropper.scale(dimensionsRatio, dimensionsRatio);\n scope.onReady && scope.onReady();\n });\n\n scope.$watch(function() { return scope.scale }, handleScaleChange);\n scope.$watch(function() { return scope.width }, handleRatioChanged);\n scope.$watch(function() { return scope.height }, handleRatioChanged);\n\n scope.options.crop = handleCrop;\n\n scope.$on('$destroy', function() {\n self.cropper.destroy();\n });\n }\n\n function handleScaleChange(scalePercent) {\n var scale = scalePercent / 100;\n self.cropper.scale(scale - zoomRatioOffset, scale - zoomRatioOffset);\n \n }\n\n function handleRatioChanged() {\n scope.scale = 100;\n\n var ratio = scope.width / scope.height;\n self.cropper.setAspectRatio(ratio);\n \n var canvasData = self.cropper.getCanvasData();\n var cropBoxData = self.cropper.getCropBoxData();\n var widthRatio = cropBoxData.width / canvasData.width;\n var heightRatio = cropBoxData.height / canvasData.height;\n var dimensionsRatio = widthRatio > heightRatio ? widthRatio : heightRatio;\n zoomRatioOffset = 1 - dimensionsRatio;\n\n self.cropper.scale(dimensionsRatio, dimensionsRatio);\n }\n\n function handleCropMove() {\n scope.cropBoxData = self.cropper.getCropBoxData();\n }\n\n function handleCrop() {\n var width = orderHelperService.convertInchesToPx(scope.width);\n var height = orderHelperService.convertInchesToPx(scope.height);\n\n return self.cropper.getCroppedCanvas({\n width: width * 4,\n height: height * 4,\n imageSmoothingEnabled: true,\n imageSmoothingQuality: 'high',\n });\n }\n }\n }\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular.module('home').component('appImageUpload', {\n templateUrl:\n 'app/main/home/image-upload/image-upload.component.html',\n controller: ImageUploadComponent,\n controllerAs: 'vm',\n bindings: {\n openDialog: '&',\n handleFile: '&',\n },\n });\n\n function ImageUploadComponent($element) {\n var vm = this;\n\n var dragEventCounter = 0;\n var $uploadWrapper = $element.children().first();\n\n $element.on('dragover', preventEventBubble);\n $element.on('dragenter', function(e) {\n preventEventBubble(e);\n ++dragEventCounter;\n \n $uploadWrapper.addClass('drop');\n });\n\n $element.on('dragleave', function(e) {\n preventEventBubble(e);\n --dragEventCounter;\n\n if (!dragEventCounter) {\n $uploadWrapper.removeClass('drop');\n }\n });\n\n $element.on('drop', function(e) {\n preventEventBubble(e);\n dragEventCounter = 0;\n\n if (!e.originalEvent.dataTransfer) {\n return false;\n }\n selectFile(e.originalEvent.dataTransfer.files);\n return false;\n });\n\n function preventEventBubble(e) {\n e.preventDefault();\n e.stopPropagation();\n }\n\n function selectFile(files) {\n if (!files || files.length !== 1 || !validateFile(files[0])) {\n return false;\n }\n vm.handleFile({ $event: files[0] });\n }\n\n function validateFile(file) {\n return file.type && file.type.indexOf('image') !== -1;\n }\n }\n})();\n\n(function() {\n\t'use strict';\n\n\tangular.module('checkout').component('appAddress', {\n\t\ttemplateUrl: 'app/main/checkout/address/address.component.html',\n\t\tcontroller: AddressComponent,\n controllerAs: 'vm',\n require : {\n form : '^form'\n },\n\t\tbindings: {\n orderMetadata: '='\n\t\t},\n\t});\n\n\tfunction AddressComponent($element, statesService, countriesService) {\n\t\tvar vm = this;\n\n vm.states = getStates();\n vm.countries = getCountries();\n\n function getStates() {\n var states = statesService.getAll().map(pickName);\n return states.map(mapToItem);\n }\n\n function getCountries() {\n var states = countriesService.getAll().map(pickName);\n return states.map(mapToItem);\n }\n\n function pickName(item) {\n return item.name;\n }\n\n function mapToItem(option) {\n return { label: option, value: option };\n }\n\t}\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.directives', []);\n\n})();\n\n(function() {\n 'use strict';\n\n angular.module('app.directives').component('appDropdown', {\n templateUrl: 'app/common/components/dropdown/dropdown.component.html',\n controller: DropdownComponent,\n controllerAs: 'vm',\n require: {\n ngModelCtrl: 'ngModel',\n },\n bindings: {\n ngModel: '=',\n options: '<',\n placeholder: '<',\n disabled: '<',\n },\n });\n\n function DropdownComponent($element) {\n var vm = this;\n\n vm.select = select;\n vm.toggle = toggle;\n vm.close = close;\n vm.getCurrentValue = getCurrentValue;\n vm.getCurrentValueIndex = getCurrentValueIndex;\n vm.getOptionsHeight = getOptionsHeight;\n vm.hasRichContent = hasRichContent;\n\n vm.hashKey = Math.random() * 100;\n vm.isOpened = false;\n \n function getCurrentValue() {\n var placeholder = vm.placeholder || 'Select one';\n if (typeof vm.ngModel === 'undefined' || vm.ngModel === null) {\n return placeholder;\n }\n var index = getCurrentValueIndex();\n return index >= 0 ? (vm.options[index].label || vm.options[index].value) : placeholder;\n }\n\n function getCurrentValueIndex() {\n if (!vm.options || !vm.options.findIndex) {\n return -1;\n }\n return vm.options.findIndex(function(item) {\n return item.value === vm.ngModel;\n });\n }\n\n function toggle() {\n if (vm.disabled) {\n return undefined;\n }\n vm.isOpened = !vm.isOpened;\n }\n\n function close() {\n vm.isOpened = false;\n }\n\n function select(selected) {\n vm.ngModel = selected;\n vm.isOpened = false;\n }\n\n function getOptionsHeight() {\n var dropdownOptions = $element.find('li');\n if (!dropdownOptions || !dropdownOptions.length) {\n return 0;\n }\n var maxItems = 4;\n var dropdownHeight = 0;\n for (var i = 0; i < Math.min(maxItems, dropdownOptions.length); i++) {\n dropdownHeight += Math.abs(dropdownOptions[i].offsetHeight);\n }\n return dropdownHeight;\n }\n\n function hasRichContent() {\n return vm.options && vm.options[0] && vm.options[0].html;\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('main')\n .factory('stripeService', StripeService);\n\n function StripeService(ENV_VARS) {\n var stripe = Stripe(ENV_VARS.stripeKey);\n return {\n createHandler: createHandler,\n createToken: createToken,\n createElements: createElements,\n createCard: createCard,\n createCardExpiration: createCardExpiration,\n createCardCvc: createCardCvc,\n };\n\n function createHandler(image, callback) {\n return StripeCheckout.configure({\n key: ENV_VARS.stripeKey,\n image: image,\n locale: 'auto',\n shippingAddress: true,\n billingAddress: true,\n token: callback\n });\n }\n \n function createToken(card) {\n return stripe.createToken(card)\n .then(function(data) {\n if (!data.token) {\n return Promise.reject(data.error);\n }\n return data.token;\n });\n }\n\n function createElements() {\n return stripe.elements({\n fonts: [{\n family: 'Futura',\n weight: 400,\n src: 'url(https://orangepiel.scaliolabs.com/assets/fonts/FuturaLT.ttf) format(\"truetype\")',\n unicodeRange: 'U+0000-00FF, U+0131, U+0152-0153, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2212, U+2215',\n }],\n });\n }\n\n function createCard(elements) {\n var style = getElementsStyle();\n return elements.create('cardNumber', { style: style, placeholder: '' });\n }\n\n function createCardExpiration(elements) {\n var style = getElementsStyle();\n return elements.create('cardExpiry', { style: style, placeholder: 'MM / YY' });\n }\n\n function createCardCvc(elements) {\n var style = getElementsStyle();\n return elements.create('cardCvc', { style: style, placeholder: '' });\n }\n\n function getElementsStyle(override) {\n override = override || {};\n var base = angular.extend({\n color: '#555555',\n fontSize: '15px',\n fontFamily: 'Futura',\n '::placeholder': {\n color: '#555555',\n },\n }, override);\n return { base: base, invalid: { color: '#555555' }};\n }\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('main')\n .factory('ordersService', OrdersService);\n\n function OrdersService(API, apiHelperService, $log) {\n return {\n create: create,\n subscribeProduct: subscribeProduct,\n };\n\n function create(data) {\n var req = {\n method: 'POST',\n url: API.ORDERS,\n data: data\n };\n return apiHelperService.sendHTTPRequest(req);\n }\n\n function subscribeProduct(data) {\n var req = {\n method: 'POST',\n url: API.ORDERS + '/subscribe',\n data: data\n };\n return apiHelperService.sendHTTPRequest(req);\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('main')\n .factory('orderHelperService', OrderHelperService);\n\n function OrderHelperService() {\n return {\n convertPxToInches: convertPxToInches,\n convertInchesToPx: convertInchesToPx,\n getEstimatedCost: getEstimatedCost,\n getFormOptions: getFormOptions,\n getMainFormOptions: getMainFormOptions,\n getInchesOptions: getInchesOptions,\n getBaseMetadataKeys: getBaseMetadataKeys,\n isTaxIncluded: isTaxIncluded,\n getTotalOrderCost: getTotalOrderCost,\n getOrderTax: getOrderTax,\n getFractionalInchesOptions: getFractionalInchesOptions,\n };\n\n function getEstimatedCost(metadata) {\n var baselineCost = 30;\n var dimensionsCost = calcSizeCost(metadata);\n var fasciaOptions = getFasciaOptions(metadata);\n var motorizationOptions = getMotorizationOptions();\n \n var amenitiesCost = 0;\n amenitiesCost += findPriceByValue(metadata.fascia, fasciaOptions);\n amenitiesCost += findPriceByValue(metadata.motorization, motorizationOptions);\n return amenitiesCost + dimensionsCost + baselineCost; \n }\n\n function convertInchesToPx(inches) {\n var ratio = 5;\n return inches * ratio;\n }\n\n function convertPxToInches(pixels) {\n var ratio = 0.2;\n return pixels * ratio;\n }\n\n function formatPrice(label, price) {\n return label + ' (+$' + price + ')';\n }\n\n function getNoneOption() {\n return { label: 'None', value: 'None', price: 0 };\n }\n\n function findPriceByValue(value, collection) {\n if (!value || !collection) return 0;\n\n var index = collection.findIndex(function(item) {\n return item.value === value;\n });\n return index >= 0 ? collection[index].price : 0;\n }\n\n function getFabricStyleOptions() {\n var options = [{\n value: 'Sheer-Weave Fabric',\n description: 'Let the sun in. See through your shade.',\n image: '/assets/images/sheerweave.svg',\n }, {\n value: 'Backlit Fabric',\n description: 'Backlight your shade, with privacy. Nobody sees-through.',\n image: '/assets/images/backlit.svg',\n },\n {\n value: 'Blackout Fabric',\n description: 'Keep wandering eyes and sunlight out. Completely dark.',\n image: '/assets/images/blackout.svg',\n }];\n return options.map(function(item) {\n return {\n value: item.value,\n html: '
'\n + '
'\n + ''\n + '

' + item.description + '

',\n };\n });\n }\n function getFasciaOptions(metadata) {\n var pricing = getFasciaPricing();\n var index = metadata ? calcDimensionIndex(metadata.width, metadata.widthFraction, 24) : 0;\n \n var options = [{\n value: 'No Fascia',\n image: '/assets/images/no-fascia.svg',\n description: 'No fascia.',\n price: 0,\n },\n {\n value: 'White',\n image: '/assets/images/white-fascia.svg',\n description: 'Cover your roller with white fascia.',\n price: pricing[index],\n }, {\n value: 'Black',\n image: '/assets/images/black-fascia.svg',\n description: 'Cover your roller with black fascia.',\n price: pricing[index],\n }, {\n value: 'Anodized Aluminum',\n image: '/assets/images/aluminum-fascia.svg',\n description: 'Cover your roller with anodized aluminum fascia.',\n price: pricing[index],\n }];\n return options.map(function(item) {\n return { \n price: item.price, \n value: item.value,\n html: '
'\n + '
'\n + '+$' + item.price + ''\n + '

' + item.description + '

',\n };\n });\n }\n function getMotorizationOptions() {\n var index = 0;\n var options = [{\n value: 'No Motorization',\n image: '/assets/images/no-motor.svg',\n description: 'All shades include chain control. Select your color on Options tab.',\n price: 0,\n }, \n {\n value: 'Battery-Operated w/ Wireless Remote',\n image: '/assets/images/remote-battery.svg',\n description: 'Somfy R28 WireFree Motor w/ Wireless Handheld Remote',\n price: 295,\n }, {\n value: 'Battery-Operated w/ Wireless Wall-mount',\n image: '/assets/images/wall-battery.svg',\n description: 'Somfy R28 WireFree Motor w/ Wireless Wall-mount Remote',\n price: 370,\n }, {\n value: 'Hardwired Motor w/ Wireless Remote',\n image: '/assets/images/remote-hardwire.svg',\n description: 'Somfy Sonesse 50 QUIET Motor w/ Wireless Handheld Remote',\n price: 475,\n },\n {\n value: 'Hardwired Motor w/ Wireless Wall-mount',\n image: '/assets/images/wall-hardwire.svg',\n description: 'Somfy Sonesse 50 QUIET Motor w/ Wireless Wall-mount Remote',\n price: 550,\n }];\n return options.map(function(item){\n return {\n price: item.price,\n value: item.value,\n html: '
'\n + '
'\n + '+$' + item.price + ''\n + '

' + item.description + '

',\n };\n });\n // }));\n }\n // function getMotorizationOptions() {\n // var options = {\n // 'Somfy R28 WireFree Motor (Battery) w/ Wireless Handheld Remote': 295,\n // 'Somfy R28 WireFree Motor (Battery) w/ Wireless Wall-mount Remote': 370,\n // 'Somfy Sonesse 50 QUIET Motor (Hardwire) w/ Wireless Handheld Remote': 475,\n // 'Somfy Sonesse 50 QUIET Motor (Hardwire) w/ Wireless Wall-mount Remote': 550\n // };\n\n // var motorization = [getNoneOption()];\n // return motorization.concat(Object.keys(options).map(function(opt) {\n // return {\n // price: options[opt],\n // label: formatPrice(opt, options[opt]),\n // value: opt,\n // };\n // }));\n // }\n \n function getMainFormOptions(metadata) {\n return [\n { label: 'Fabric Style', fieldKey: 'fabric', ignoreToggle: true, modalFilename: 'fabric-style.view', options: getFabricStyleOptions()},\n { label: 'Motorization', fieldKey: 'motorization',modalFilename: 'motorization.view', options: getMotorizationOptions(metadata) },\n { label: 'Fascia', fieldKey: 'fascia',modalFilename: 'fascia.view', options: getFasciaOptions(metadata) },\n ]\n }\n\n function getImageOrientationOptions() {\n var options = [{\n value: 'Interior Facing',\n description: 'Printed side of shade faces AWAY from the window glass.',\n image: '/assets/images/interior-facing.svg',\n },{\n value: 'Exterior Facing',\n description: 'Printed side of shade faces TOWARDS the window glass.',\n image: '/assets/images/exterior-facing.svg',\n }];\n return options.map(function(item) {\n return {\n value: item.value,\n html: '
'\n + '
'\n + ''\n + '

' + item.description + '

',\n };\n });\n }\n function getMountingStyleOptions() {\n var options = [{\n value: 'Outside Mount',\n description: 'Shade mounted outside and above window box.',\n image: '/assets/images/outside-mount.svg',\n }, {\n value: 'Inside Mount',\n description: 'Shade mounted inside window box.',\n image: '/assets/images/inside-mount.svg',\n }];\n return options.map(function(item) {\n return {\n value: item.value,\n html: '
'\n + '
'\n + ''\n + '

' + item.description + '

',\n };\n });\n }\n function getRollTypeOptions() {\n var options = [{\n value: 'Reverse Roll',\n description: 'Fabric falls off the FRONT of the roll.',\n image: '/assets/images/reverse-roll.svg',\n },{\n value: 'Regular Roll',\n description: 'Fabric falls off the BACK of the roll.',\n image: '/assets/images/regular-roll.svg',\n }];\n return options.map(function(item) {\n return {\n value: item.value,\n html: '
'\n + '
'\n + ''\n + '

' + item.description + '

',\n };\n });\n }\n\n function getMotorPositionOptions() {\n var options = [{\n value: 'Right Side',\n description: 'Motor is used to raise and lower window shade.',\n image: '/assets/images/right-motor.svg',\n }, {\n value: 'Left Side',\n description: 'Motor is used to raise and lower window shade.',\n image: '/assets/images/left-motor.svg',\n }];\n return options.map(function(item) {\n return {\n value: item.value,\n html: '
'\n + '
'\n + ''\n + '

' + item.description + '

',\n };\n });\n }\n\n function getControlPositionOptions() {\n var options = [{\n value: 'Right Side',\n description: 'Chain is used to raise and lower window shade.',\n image: '/assets/images/right-control.svg',\n }, {\n value: 'Left Side',\n description: 'Chain is used to raise and lower window shade.',\n image: '/assets/images/left-control.svg',\n }];\n return options.map(function(item) {\n return {\n value: item.value,\n html: '
'\n + '
'\n + ''\n + '

' + item.description + '

',\n };\n });\n }\n function getControlColorOptions() {\n var options = [{\n value: 'White',\n description: 'Continuous nylon cord with white plastic beads.',\n image: '/assets/images/white-chain.svg',\n }, {\n value: 'Black',\n description: 'Continuous nylon cord with black plastic beads.',\n image: '/assets/images/black-chain.svg',\n },\n {\n value: 'Stainless Steel',\n description: 'Rust resistant stainless steel chain.',\n image: '/assets/images/aluminum-chain.svg',\n }];\n return options.map(function(item) {\n return {\n value: item.value,\n html: '
'\n + '
'\n + ''\n + '

' + item.description + '

',\n };\n });\n }\n function getFormOptions() {\n return [\n { \n label: 'Mounting Style',\n fieldKey: 'mounting', \n options: getMountingStyleOptions(), \n modalFilename: 'mounting-options.view' \n },\n { \n label: 'Image Orientation', \n fieldKey: 'imageOrientation', \n options: getImageOrientationOptions(),\n modalFilename: 'image-orientation.view'\n },\n { \n label: 'Roll Type', \n fieldKey: 'rollType', \n options: getRollTypeOptions(),\n modalFilename: 'roll-type.view',\n isDisabled: function(orderMetadata) {\n return orderMetadata && orderMetadata.fascia !== 'No Fascia';\n }\n },\n { \n label: 'Chain Position', \n fieldKey: 'controlPosition', \n options: getControlPositionOptions(),\n modalFilename: 'chain-position.view',\n isVisible: function(orderMetadata) {\n return orderMetadata && orderMetadata.motorization === 'No Motorization';\n }\n },\n { \n label: 'Motor Position', \n fieldKey: 'controlPosition', \n options: getMotorPositionOptions(),\n modalFilename: 'motor-position.view',\n isVisible: function(orderMetadata) {\n return orderMetadata && orderMetadata.motorization !== 'No Motorization';\n }\n },\n { \n label: 'Chain Color', \n fieldKey: 'controlColor', \n options: getControlColorOptions(),\n modalFilename: 'chain-color.view',\n disabledMessage: 'Not applicable with motorization',\n isDisabled: function(orderMetadata) {\n return orderMetadata && orderMetadata.motorization !== 'No Motorization';\n }\n },\n ];\n }\n\n function getInchesOptions(start, count) {\n return Array.apply(0, Array(count - start + 1))\n .map(function (element, index) { \n var val = index + start;\n return toInchesOption(val);\n });\n }\n\n function toInchesOption(val) {\n return { value: val, label: val + '″' }; \n }\n\n function toLabelValueObj(item) {\n return { value: item, label: item }; \n }\n\n function getFractionalInchesOptions() {\n return ['0', '1/8', '1/4', '3/8', '1/2', '5/8', '3/4', '7/8'].map(toInchesOption);\n }\n \n function calcSizeCost(metadata) {\n var min = 24, step = 6, count = 25;\n\n var widthId = calcDimensionIndex(metadata.width, metadata.widthFraction, count - 1);\n var heightId = calcDimensionIndex(metadata.height, metadata.heightFraction, count - 2);\n\n var offset = heightId * count;\n var pricing = getShadesPricing();\n return pricing[offset + widthId];\n }\n\n function calcDimensionIndex(whole, fraction, max) {\n var min = 24, step = 6, count = 25;\n var index = parseInt((whole - min) / step);\n if (((whole - min) % step || (fraction && fraction !== '0')) && index + 1 <= max) {\n return index + 1;\n }\n return index;\n }\n\n function getOrderTax(orderMetadata) {\n var shippingAddress = orderMetadata.shippingAddress;\n if (!isTaxIncluded(shippingAddress)) {\n return undefined;\n }\n var taxesRatings = getTaxesRatings();\n return taxesRatings[shippingAddress.state];\n }\n\n function isTaxIncluded(shippingAddress) {\n var states = Object.keys(getTaxesRatings());\n return states.indexOf(shippingAddress.state) >= 0;\n }\n\n function getTotalOrderCost(orderCost, orderMetadata) {\n if (!isTaxIncluded(orderMetadata.shippingAddress)) {\n return orderCost;\n }\n return orderCost + (orderCost * getOrderTax(orderMetadata) / 100);\n }\n\n function getTaxesRatings() {\n return {\n 'California': 8.75,\n };\n }\n\n function getBaseMetadataKeys() {\n return [\n 'width',\n 'height',\n 'scale',\n 'widthFraction',\n 'heightFraction',\n ];\n }\n\n function getShadesPricing() {\n return [240.08,249.10,255.13,266.00,275.17,336.19,354.21,369.23,428.25,449.27,461.29,477.31,483.33,643.35,649.38,731.40,787.42,805.44,811.46,851.48,907.50,927.52,933.54,975.56,981.58,\n 244.33,254.42,261.50,273.58,283.67,345.75,364.83,380.92,441.00,463.08,476.17,493.25,500.33,661.42,668.50,751.58,808.67,827.75,834.83,875.92,933.00,954.08,961.17,1004.25,1011.33,\n 248.58,259.73,267.88,281.02,292.17,355.31,375.46,392.60,453.75,476.90,491.04,509.19,517.33,679.48,687.63,771.77,829.92,850.06,858.21,900.35,958.50,980.65,988.79,1032.94,1041.08,\n 252.83,268.04,277.25,291.46,302.67,366.88,388.08,406.29,468.50,492.71,507.92,527.13,536.33,699.54,708.75,793.96,853.17,874.38,883.58,926.79,986.00,1009.21,1018.42,1063.63,1072.83,\n 259.08,273.35,283.63,298.90,311.17,376.44,398.71,417.98,481.25,506.52,522.79,543.06,553.33,717.60,727.88,814.15,874.42,896.69,906.96,951.23,1011.50,1035.77,1046.04,1092.31,1102.58,\n 263.33,280.67,292.00,308.33,322.67,389.00,411.33,431.67,496.00,522.33,539.67,561.00,572.33,737.67,749.00,836.33,897.67,921.00,932.33,977.67,1039.00,1064.33,1075.67,1124.00,1135.33,\n 269.58,285.98,298.38,315.77,331.17,398.56,421.96,443.35,508.75,536.15,554.54,576.94,589.33,755.73,768.13,856.52,918.92,943.31,955.71,1002.10,1064.50,1090.90,1103.29,1152.69,1165.08,\n 273.83,293.29,306.75,325.21,341.67,410.13,434.58,457.04,523.50,552.96,571.42,594.88,608.33,775.79,789.25,880.71,944.17,969.63,983.08,1031.54,1095.00,1121.46,1134.92,1185.38,1198.83,\n 280.08,298.60,313.13,332.65,350.17,419.69,445.21,468.73,536.25,566.77,586.29,610.81,625.33,793.85,808.38,900.90,965.42,991.94,1006.46,1055.98,1120.50,1148.02,1162.54,1214.06,1228.58,\n 286.33,305.92,321.50,342.08,360.67,431.25,457.83,482.42,551.00,582.58,603.17,629.75,645.33,813.92,829.50,926.08,991.67,1018.25,1033.83,1084.42,1150.00,1179.58,1195.17,1246.75,1262.33,\n 290.58,311.23,327.88,349.52,369.17,440.81,468.46,494.10,563.75,596.40,618.04,645.69,662.33,831.98,848.63,946.27,1012.92,1040.56,1057.21,1108.85,1175.50,1206.15,1222.79,1275.44,1292.08,\n 296.83,318.54,336.25,358.96,379.67,452.38,481.08,507.79,585.50,612.21,634.92,683.63,701.33,917.04,934.75,968.46,1036.17,1085.88,1103.58,1135.29,1203.00,1236.71,1254.42,1308.13,1325.83,\n 301.08,323.85,342.63,366.40,388.17,461.94,491.71,519.48,598.25,626.02,649.79,699.56,718.33,935.10,953.88,988.65,1057.42,1108.19,1126.96,1159.73,1228.50,1263.27,1282.04,1336.81,1355.58,\n 307.33,331.17,351.00,375.83,398.67,473.50,510.33,540.17,613.00,641.83,666.67,717.50,737.33,955.17,975.00,1010.83,1080.67,1132.50,1152.33,1188.17,1258.00,1293.83,1313.67,1369.50,1389.33,\n 311.58,336.48,357.38,383.27,407.17,483.06,520.96,551.85,625.75,655.65,681.54,733.44,754.33,973.23,994.13,1031.02,1101.92,1154.81,1175.71,1212.60,1283.50,1320.40,1341.29,1398.19,1419.08,\n 329.83,355.79,377.75,405.71,430.67,508.63,533.58,561.54,636.50,671.46,699.42,751.38,773.33,993.29,1015.25,1053.21,1125.17,1179.13,1201.08,1243.04,1315.00,1352.96,1374.92,1490.88,1512.83,\n 334.08,361.10,384.13,413.15,439.17,518.19,544.21,573.23,649.25,685.27,714.29,767.31,790.33,1011.35,1034.38,1073.40,1146.42,1201.44,1224.46,1267.48,1340.50,1379.52,1402.54,1519.56,1542.58,\n 340.33,370.42,394.50,424.58,453.67,533.75,562.83,592.92,672.00,701.08,731.17,785.25,809.33,1031.42,1055.50,1095.58,1169.67,1227.75,1251.83,1293.92,1368.00,1408.08,1432.17,1552.25,1576.33,\n 344.58,375.73,400.88,432.02,462.17,543.31,573.46,604.60,684.75,714.90,746.04,801.19,826.33,1049.48,1074.63,1115.77,1190.92,1250.06,1275.21,1318.35,1393.50,1434.65,1459.79,1580.94,1606.08,\n 350.83,383.04,409.25,441.46,472.67,554.88,586.08,618.29,699.50,730.71,762.92,819.13,845.33,1069.54,1095.75,1137.96,1214.17,1275.38,1301.58,1346.79,1423.00,1467.21,1493.42,1617.63,1643.83,\n 355.08,388.35,415.63,448.90,481.17,564.44,596.71,629.98,712.25,744.52,777.79,835.06,862.33,1087.60,1114.88,1158.15,1235.42,1297.69,1324.96,1371.23,1448.50,1493.77,1521.04,1646.31,1673.58,\n 361.33,396.67,425.00,458.33,492.67,576.00,610.33,643.67,728.00,761.33,794.67,853.00,881.33,1107.67,1136.00,1180.33,1258.67,1322.00,1350.33,1402.67,1481.00,1528.33,1556.67,1685.00,1713.33,\n 365.58,401.98,431.38,465.77,501.17,585.56,620.96,655.35,740.75,775.15,809.54,868.94,898.33,1125.73,1155.13,1200.52,1279.92,1344.31,1373.71,1427.10,1506.50,1554.90,1584.29,1713.69,1743.08,\n 369.83,407.29,437.75,473.21,509.67,595.13,631.58,667.04,753.50,788.96,824.42,884.88,915.33,1143.79,1174.25,1220.71,1301.17,1366.63,1397.08,1451.54,1532.00,1581.46,1611.92,1742.38,1772.83];\n }\n\n function getFasciaPricing() {\n return [33, 35, 37, 37, 38, 40, 42, 46, 46, 52, 52, 64, 64, 69, 69, 79, 79, 90, 90, 100, 100, 100, 100, 100, 100];\n }\n }\n})();\n\n(function() {\n\t'use strict';\n\n\tangular.module('main').factory('cartService', CartService);\n\n\tfunction CartService() {\n var self = this;\n\n self.orderMetadata = createOrderMetadata();\n\n\t\treturn {\n getOrderMetadata: getOrderMetadata,\n remove: remove,\n };\n\n\t\tfunction getOrderMetadata() {\n\t\t\treturn self.orderMetadata;\n }\n\n function remove() {\n self.orderMetadata = createOrderMetadata();\n }\n \n function createOrderMetadata() {\n return {\n width: 30,\n height: 30,\n scale: 100,\n widthFraction: '',\n heightFraction: '',\n billingAddress: {\n country: 'United States',\n },\n shippingAddress: {\n country: 'United States',\n },\n rollType: 'Reverse Roll',\n\t\t\t};\n }\n\t}\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('home')\n .controller('HomeController', HomeController);\n\n function HomeController($log, $parse, $scope) {}\n})();\n\n(function() {\n\t'use strict';\n\n\tangular\n\t\t.module('checkout')\n\t\t.controller('CheckoutController', CheckoutController);\n\n\tfunction CheckoutController(\n\t\t$log,\n\t\t$scope,\n\t\t$rootScope,\n\t\t$state,\n\t\tstripeService,\n\t\tcartService,\n\t\tfileHelperService,\n\t\tselectHelperService,\n\t\torderModalService,\n\t\tordersService,\n\t\torderHelperService\n\t) {\n\t\tvar vm = this;\n\n\t\tvm.isOrderProcessing = false;\n\t\tvm.orderCost = vm.totalOrderCost = vm.orderTax = 0;\n\t\tvm.isBillingAddressHidden = true;\n\t\tvm.shippingForm = vm.paymentForm = {};\n \tvm.stripeErrors = {};\n\n\t\tvm.editShade = editShade;\n\t\tvm.removeShade = removeShade;\n\t\tvm.getMotorization = getMotorization;\n\t\tvm.submitOrder = submitOrder;\n\t\tvm.isTaxIncluded = isTaxIncluded;\n\n\t\t$scope.$watch(function() {\n\t\t\treturn vm.orderTax;\n\t\t}, calculateOrderCost);\n\n\t\t(function init() {\n\t\t\tvm.orderMetadata = cartService.getOrderMetadata();\n var isCartEmpty = !vm.orderMetadata.imageBlob;\n\t\t\tif (isCartEmpty) {\n\t\t\t\treturn $state.go('home');\n\t\t\t}\n\t\t\tcalculateOrderCost();\n\t\t\tinitStripeElements();\n\t\t})();\n\n\t\tfunction initStripeElements() {\n\t\t\tvar elements = stripeService.createElements();\n vm.stripeCard = stripeService.createCard(elements);\n \n stripeService.createCardExpiration(elements).mount('.card-expiration');\n stripeService.createCardCvc(elements).mount('.card-cvc');\n\t\t\tvm.stripeCard.mount('.card-number');\n\t\t}\n\n\t\tfunction editShade() {\n\t\t\t$state.go('home');\n\t\t}\n\n\t\tfunction removeShade() {\n\t\t\tcartService.remove();\n\t\t\t$state.go('home');\n\t\t}\n\n\t\tfunction isTaxIncluded() {\n\t\t\tvm.orderTax = orderHelperService.getOrderTax(vm.orderMetadata);\n\t\t\tif (!vm.orderTax) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\n\t\tfunction submitOrder() {\n\t\t\ttriggerFormValidation(vm.shippingForm);\n\t\t\tif (!vm.shippingForm.$valid) return;\n\n\t\t\tvm.isOrderProcessing = true;\n\t\t\tstripeService\n\t\t\t\t.createToken(vm.stripeCard)\n\t\t\t\t.then(handleStripeToken)\n\t\t\t\t.catch(function(err) {\n vm.isOrderProcessing = false;\n \n validateStripeFields(err);\n\t\t\t\t\t$log.error('stripeToken-error', err);\n\t\t\t\t\t$scope.$apply();\n\t\t\t\t});\n\t\t}\n\n\t\tfunction handleStripeToken(obj) {\n\t\t\tsetTimeout(showOrderModal, 500);\n\n\t\t\tvar originalImage = fileHelperService.dataURItoBlob(\n\t\t\t\tvm.orderMetadata.imageBlob\n\t\t\t);\n\t\t\tvar imagesPromises = [\n\t\t\t\tfileHelperService.uploadImage(vm.orderMetadata.croppedImage, 0),\n\t\t\t\tfileHelperService.uploadImage(originalImage, 1),\n\t\t\t];\n\t\t\treturn Promise.all(imagesPromises)\n\t\t\t\t.then(function(urls) {\n\t\t\t\t\tif (!urls[0] || !urls[1]) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\treturn createOrder(obj, urls[0], urls[1]);\n\t\t\t\t})\n\t\t\t\t.catch(function(err) {\n\t\t\t\t\t$rootScope.$broadcast('orderStateChange', false);\n\t\t\t\t});\n\t\t}\n\n\t\tfunction showOrderModal() {\n\t\t\tvm.isOrderProcessing = false;\n\t\t\torderModalService.show();\n\t\t}\n\n\t\tfunction createOrder(stripeObj, croppedUrl, originalUrl) {\n\t\t\tvar data = {\n\t\t\t\ttoken: stripeObj.id,\n email: vm.orderMetadata.email,\n phone: vm.orderMetadata.phone,\n\t\t\t\tshipmentAddress: vm.orderMetadata.shippingAddress,\n\t\t\t\tbillingAddress: vm.orderMetadata.billingAddress,\n\t\t\t\tamount: vm.orderCost * 100, // cents\n\t\t\t\ttotalAmount: vm.totalOrderCost * 100, // cents\n\t\t\t\tmetadata: parseMetadata(),\n\t\t\t\tcroppedUrl: croppedUrl,\n\t\t\t\toriginalUrl: originalUrl,\n\t\t\t};\n\t\t\treturn ordersService\n\t\t\t\t.create(data)\n\t\t\t\t.then(function(response) {\n\t\t\t\t\t$log.debug('orderService-success', response);\n $rootScope.$broadcast('orderStateChange', true);\n $state.go('home');\n\t\t\t\t})\n\t\t\t\t.catch(function() {\n\t\t\t\t\t$rootScope.$broadcast('orderStateChange', false);\n\t\t\t\t});\n\t\t}\n\n\t\tfunction parseMetadata() {\n\t\t\tvar metadata = {};\n\t\t\tvar mainFormOptions = orderHelperService.getMainFormOptions();\n\t\t\tvar formOptions = orderHelperService\n\t\t\t\t.getFormOptions()\n\t\t\t\t.concat(mainFormOptions);\n\n\t\t\tvar metadataKeys = orderHelperService.getBaseMetadataKeys();\n\t\t\tvar keys = formOptions.map(function(item) {\n\t\t\t\treturn item.fieldKey;\n }).concat(metadataKeys);\n\n\t\t\tkeys.forEach(function(key) {\n\t\t\t\tmetadata[key] = selectHelperService.parse(vm.orderMetadata[key]);\n\t\t\t});\n\t\t\treturn metadata;\n\t\t}\n\n\t\tfunction triggerFormValidation(form) {\n\t\t\tangular.forEach(form.$error.required, function(field) {\n\t\t\t\tfield.$setDirty();\n\t\t\t});\n\t\t}\n\n\t\tfunction calculateOrderCost() {\n\t\t\tvm.orderCost = orderHelperService.getEstimatedCost(vm.orderMetadata);\n\t\t\tif (!isTaxIncluded()) {\n\t\t\t\tvm.totalOrderCost = vm.orderCost;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tvm.totalOrderCost = orderHelperService.getTotalOrderCost(\n\t\t\t\tvm.orderCost,\n\t\t\t\tvm.orderMetadata\n\t\t\t);\n\t\t}\n\n\t\tfunction getMotorization() {\n\t\t\treturn vm.orderMetadata.motorization === 'None'\n\t\t\t\t? 'No Motorization'\n\t\t\t\t: vm.orderMetadata.motorization;\n }\n \n function validateStripeFields(error) {\n var code = error.code;\n if (code.includes('number')) {\n vm.stripeErrors = { card: true };\n }\n else if (code.includes('cvc')) {\n vm.stripeErrors = { cvc: true };\n }\n else if (code.includes('expiry')) {\n vm.stripeErrors = { expiry: true };\n }\n }\n\t}\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.services', [\n 'app.services.utility'\n ]);\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.filters', []);\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.filters')\n .filter('phonenumberFilter', phonenumberFilter);\n\n function phonenumberFilter() {\n\n return function(tel) {\n if (!tel) {\n return '';\n }\n\n var value = tel.toString().trim().replace(/^\\+/, '');\n\n if (value.match(/[^0-9]/)) {\n return tel;\n }\n\n var country, city, number;\n\n switch (value.length) {\n case 10: // +1PPP####### -> C (PPP) ###-####\n country = 1;\n city = value.slice(0, 3);\n number = value.slice(3);\n break;\n\n case 11: // +CPPP####### -> CCC (PP) ###-####\n country = value[0];\n city = value.slice(1, 4);\n number = value.slice(4);\n break;\n\n case 12: // +CCCPP####### -> CCC (PP) ###-####\n country = value.slice(0, 3);\n city = value.slice(3, 5);\n number = value.slice(5);\n break;\n\n default:\n return tel;\n }\n\n if (country == 1) {\n country = \"\";\n }\n\n number = number.slice(0, 3) + '-' + number.slice(3);\n\n return (country + \" (\" + city + \") \" + number).trim();\n }\n }\n\n\n function Ctrl($scope) {\n $scope.phoneNumber = 4085265552;\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.filters')\n .filter('gtEventStartDate', gtEventStartDate);\n\n function gtEventStartDate() {\n\n return function ( items, value ) {\n\n var filteredItems = []\n\n angular.forEach(items, function ( item, cnt ) {\n\n //if ( cnt > value ) {\n\n // to add event, must be past 3rd in index AND date must be current\n var today = new Date();\n var eventStartDate = new Date(item.startDate);\n\n if (eventStartDate > today) {\n filteredItems.push(item);\n }\n //}\n });\n\n\n console.log('filteredItems.length', filteredItems.length);\n\n return filteredItems;\n }\n }\n\n\n})();\n\n\n\n // function gtEventStartDate() {\n\n // return function ( items, value ) {\n // var filteredItems = []\n // angular.forEach(items, function ( item, cnt ) {\n\n // //console.log('cnt', cnt);\n\n // var today = new Date();\n // var eventStartDate = new Date(item.startDate);\n\n // if (eventStartDate > today) {\n\n // //console.log('eventStartDate > today');\n\n // if ((value==0) && (cnt > 3)) {\n\n // //console.log('no-value', value);\n\n // // if no value provided, return first 3 (upcoming) events past today\n // filteredItems.push(item); \n // }\n\n // if ((value > 0) && (cnt < 2)) {\n\n // //console.log('value', value);\n\n // // must be greater than 3rd in index AND date must be current\n // filteredItems.push(item); \n // }\n // }\n\n // });\n // return filteredItems;\n\n // }\n // }\n(function() {\n 'use strict';\n\n angular\n .module('app.filters')\n .filter('formatTime', formatTime);\n\n function formatTime() {\n\n return function(timestamp, withtime) {\n if (!timestamp)\n return;\n\n if (withtime) {\n return moment(timestamp).format('lll'); // Jan 12, 2017\n }\n\n return moment(timestamp).format('ll'); // Jan 12, 2017\n\n // below returns eg. 5 days ago\n //var res = moment(timestamp).from();\n //return replace ? res.replace('ago', replace) : res;\n }\n }\n\n\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.filters')\n .filter('capitalize', capitalize);\n\n function capitalize() {\n\n return function(input, scope) {\n if (input !=null) {\n if (input.length>=1) {\n input = input.toLowerCase();\n return input.substring(0, 1).toUpperCase() + input.substring(1);\n }\n }\n }\n }\n\n\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.filters')\n .filter('addTargetBlank', addTargetBlank);\n\n function addTargetBlank(ENV_VARS) {\n return function(content) {\n var tree = angular.element('
' + content + '
');\n angular.forEach(tree.find('a'), function(element) {\n var anchor = angular.element(element);\n if (isExternalUrl(element.hostname)) {\n anchor.attr('target', '_blank');\n }\n });\n return angular.element('
').append(tree).html(); \n }\n\n function isExternalUrl(hostname) {\n if (!hostname || typeof hostname !== 'string') {\n return false;\n }\n return hostname.search(ENV_VARS.appDomain) < 0;\n }\n }\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.components', []);\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app.directives')\n // .directive('pageTitle', pageTitle)\n // .directive('sideNavigation', sideNavigation)\n // .directive('iboxTools', iboxTools)\n // .directive('minimalizaSidebar', minimalizaSidebar)\n // .directive('vectorMap', vectorMap)\n // .directive('sparkline', sparkline)\n // .directive('icheck', icheck)\n // .directive('ionRangeSlider', ionRangeSlider)\n // .directive('dropZone', dropZone)\n // .directive('responsiveVideo', responsiveVideo)\n // .directive('chatSlimScroll', chatSlimScroll)\n // .directive('customValid', customValid)\n // .directive('fullScroll', fullScroll)\n // .directive('closeOffCanvas', closeOffCanvas)\n // .directive('clockPicker', clockPicker)\n // .directive('landingScrollspy', landingScrollspy)\n // .directive('fitHeight', fitHeight)\n // .directive('iboxToolsFullScreen', iboxToolsFullScreen)\n // .directive('slimScroll', slimScroll)\n // .directive('truncate', truncate)\n // .directive('touchSpin', touchSpin)\n // .directive('markdownEditor', markdownEditor)\n // .directive('categoryName', categoryName)\n // .directive('categorySelect', categorySelect)\n // .directive('categoryToggle', categoryToggle)\n .directive('topnavcollapse', topNavCollapse)\n .filter('cdn', cdnFilter);\n\n function cdnFilter(ENV_VARS) {\n return function(input) {\n if(!ENV_VARS || !ENV_VARS.s3BucketDomain || !ENV_VARS.cdnDomain) return input;\n return (input || '').replace(ENV_VARS.s3BucketDomain, ENV_VARS.cdnDomain);\n };\n }\n\n // /**\n // * sideNavigation - Directive for run metsiMenu on sidebar navigation\n // */\n // function sideNavigation($timeout) {\n // return {\n // restrict: 'A',\n // link: function(scope, element) {\n // // Call the metsiMenu plugin and plug it to sidebar navigation\n // $timeout(function() {\n // element.metisMenu();\n\n // });\n // }\n // };\n // };\n\n // /**\n // * responsibleVideo - Directive for responsive video\n // */\n // function responsiveVideo() {\n // return {\n // restrict: 'A',\n // link: function(scope, element) {\n // var figure = element;\n // var video = element.children();\n // video\n // .attr('data-aspectRatio', video.height() / video.width())\n // .removeAttr('height')\n // .removeAttr('width')\n\n // //We can use $watch on $window.innerWidth also.\n // $(window).resize(function() {\n // var newWidth = figure.width();\n // video\n // .width(newWidth)\n // .height(newWidth * video.attr('data-aspectRatio'));\n // }).resize();\n // }\n // }\n // }\n\n // /**\n // * iboxTools - Directive for iBox tools elements in right corner of ibox\n // */\n // function iboxTools($timeout) {\n // return {\n // restrict: 'A',\n // scope: true,\n // templateUrl: 'app/main/main-ibox_tools.view.html',\n // controller: function($scope, $element) {\n // // Function for collapse ibox\n // $scope.showhide = function() {\n // var ibox = $element.closest('div.ibox');\n // var icon = $element.find('i:first');\n // var content = ibox.find('div.ibox-content');\n // content.slideToggle(200);\n // // Toggle icon from up to down\n // icon.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');\n // ibox.toggleClass('').toggleClass('border-bottom');\n // $timeout(function() {\n // ibox.resize();\n // ibox.find('[id^=map-]').resize();\n // }, 50);\n // };\n // // Function for close ibox\n // $scope.closebox = function() {\n // var ibox = $element.closest('div.ibox');\n // ibox.remove();\n // }\n // }\n // };\n // }\n\n // /**\n // * iboxTools with full screen - Directive for iBox tools elements in right corner of ibox with full screen option\n // */\n // function iboxToolsFullScreen($timeout) {\n // return {\n // restrict: 'A',\n // scope: true,\n // templateUrl: 'app/main/main-ibox_tools_full_screen.view.html',\n // controller: function($scope, $element) {\n // // Function for collapse ibox\n // $scope.showhide = function() {\n // var ibox = $element.closest('div.ibox');\n // var icon = $element.find('i:first');\n // var content = ibox.find('div.ibox-content');\n // content.slideToggle(200);\n // // Toggle icon from up to down\n // icon.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');\n // ibox.toggleClass('').toggleClass('border-bottom');\n // $timeout(function() {\n // ibox.resize();\n // ibox.find('[id^=map-]').resize();\n // }, 50);\n // };\n // // Function for close ibox\n // $scope.closebox = function() {\n // var ibox = $element.closest('div.ibox');\n // ibox.remove();\n // };\n // // Function for full screen\n // $scope.fullscreen = function() {\n // var ibox = $element.closest('div.ibox');\n // var button = $element.find('i.fa-expand');\n // $('body').toggleClass('fullscreen-ibox-mode');\n // button.toggleClass('fa-expand').toggleClass('fa-compress');\n // ibox.toggleClass('fullscreen');\n // setTimeout(function() {\n // $(window).trigger('resize');\n // }, 100);\n // }\n // }\n // };\n // }\n\n // /**\n // * minimalizaSidebar - Directive for minimalize sidebar\n // */\n // function minimalizaSidebar($timeout) {\n // return {\n // restrict: 'A',\n // //template: '',\n // template: '
menu
',\n\n // controller: function($scope, $element) {\n // $scope.minimalize = function() {\n // angular.element('body').toggleClass('mini-navbar');\n // if (!angular.element('body').hasClass('mini-navbar') || angular.element('body').hasClass('body-small')) {\n // // Hide menu in order to smoothly turn on when maximize menu\n // angular.element('#side-menu').hide();\n // // For smoothly turn on menu\n // $timeout(function() {\n // angular.element('#side-menu').fadeIn(500);\n // }, 100);\n // }\n // else {\n // // Remove all inline style from jquery fadeIn function to reset menu state\n // angular.element('#side-menu').removeAttr('style');\n // }\n // };\n // }\n // };\n // };\n\n\n // function closeOffCanvas() {\n // return {\n // restrict: 'A',\n // template: '',\n // controller: function($scope, $element) {\n // $scope.closeOffCanvas = function() {\n // $(\"body\").toggleClass(\"mini-navbar\");\n // }\n // }\n // };\n // }\n\n // /**\n // * vectorMap - Directive for Vector map plugin\n // */\n // function vectorMap() {\n // return {\n // restrict: 'A',\n // scope: {\n // myMapData: '=',\n // },\n // link: function(scope, element, attrs) {\n // var map = element.vectorMap({\n // map: 'world_mill_en',\n // backgroundColor: \"transparent\",\n // regionStyle: {\n // initial: {\n // fill: '#e4e4e4',\n // \"fill-opacity\": 0.9,\n // stroke: 'none',\n // \"stroke-width\": 0,\n // \"stroke-opacity\": 0\n // }\n // },\n // series: {\n // regions: [{\n // values: scope.myMapData,\n // scale: [\"#1ab394\", \"#22d6b1\"],\n // normalizeFunction: 'polynomial'\n // }]\n // },\n // });\n // var destroyMap = function() {\n // element.remove();\n // };\n // scope.$on('$destroy', function() {\n // destroyMap();\n // });\n // }\n // }\n // }\n\n\n // /**\n // * sparkline - Directive for Sparkline chart\n // */\n // function sparkline() {\n // return {\n // restrict: 'A',\n // scope: {\n // sparkData: '=',\n // sparkOptions: '=',\n // },\n // link: function(scope, element, attrs) {\n // scope.$watch(scope.sparkData, function() {\n // render();\n // });\n // scope.$watch(scope.sparkOptions, function() {\n // render();\n // });\n // var render = function() {\n // $(element).sparkline(scope.sparkData, scope.sparkOptions);\n // };\n // }\n // }\n // };\n\n // /**\n // * icheck - Directive for custom checkbox icheck\n // */\n // function icheck($timeout) {\n // return {\n // restrict: 'A',\n // require: 'ngModel',\n // link: function($scope, element, $attrs, ngModel) {\n // return $timeout(function() {\n // var value;\n // value = $attrs['value'];\n\n // $scope.$watch($attrs['ngModel'], function(newValue) {\n // $(element).iCheck('update');\n // })\n\n // return $(element).iCheck({\n // checkboxClass: 'icheckbox_square-green',\n // radioClass: 'iradio_square-green'\n\n // }).on('ifChanged', function(event) {\n // if ($(element).attr('type') === 'checkbox' && $attrs['ngModel']) {\n // $scope.$apply(function() {\n // return ngModel.$setViewValue(event.target.checked);\n // });\n // }\n // if ($(element).attr('type') === 'radio' && $attrs['ngModel']) {\n // return $scope.$apply(function() {\n // return ngModel.$setViewValue(value);\n // });\n // }\n // });\n // });\n // }\n // };\n // }\n\n // /**\n // * ionRangeSlider - Directive for Ion Range Slider\n // */\n // function ionRangeSlider() {\n // return {\n // restrict: 'A',\n // scope: {\n // rangeOptions: '='\n // },\n // link: function(scope, elem, attrs) {\n // elem.ionRangeSlider(scope.rangeOptions);\n // }\n // }\n // }\n\n // /**\n // * dropZone - Directive for Drag and drop zone file upload plugin\n // */\n // function dropZone() {\n // return {\n // restrict: 'C',\n // link: function(scope, element, attrs) {\n\n // var config = {\n // url: 'http://localhost:8080/upload',\n // maxFilesize: 100,\n // paramName: \"uploadfile\",\n // maxThumbnailFilesize: 10,\n // parallelUploads: 1,\n // autoProcessQueue: false\n // };\n\n // var eventHandlers = {\n // 'addedfile': function(file) {\n // scope.file = file;\n // if (this.files[1] != null) {\n // this.removeFile(this.files[0]);\n // }\n // scope.$apply(function() {\n // scope.fileAdded = true;\n // });\n // },\n\n // 'success': function(file, response) {}\n\n // };\n\n // dropzone = new Dropzone(element[0], config);\n\n // angular.forEach(eventHandlers, function(handler, event) {\n // dropzone.on(event, handler);\n // });\n\n // scope.processDropzone = function() {\n // dropzone.processQueue();\n // };\n\n // scope.resetDropzone = function() {\n // dropzone.removeAllFiles();\n // }\n // }\n // }\n // }\n\n // /**\n // * chatSlimScroll - Directive for slim scroll for small chat\n // */\n // function chatSlimScroll($timeout) {\n // return {\n // restrict: 'A',\n // link: function(scope, element) {\n // $timeout(function() {\n // element.slimscroll({\n // height: '234px',\n // railOpacity: 0.4\n // });\n\n // });\n // }\n // };\n // }\n\n // /**\n // * customValid - Directive for custom validation example\n // */\n // function customValid() {\n // return {\n // require: 'ngModel',\n // link: function(scope, ele, attrs, c) {\n // scope.$watch(attrs.ngModel, function() {\n\n // // You can call a $http method here\n // // Or create custom validation\n\n // var validText = \"Twist\";\n\n // if (scope.extras == validText) {\n // c.$setValidity('cvalid', true);\n // }\n // else {\n // c.$setValidity('cvalid', false);\n // }\n\n // });\n // }\n // }\n // }\n\n\n // /**\n // * fullScroll - Directive for slimScroll with 100%\n // */\n // /**\n // function fullScroll($timeout){\n // return {\n // restrict: 'A',\n // link: function(scope, element) {\n // $timeout(function(){\n // element.slimscroll({\n // height: '100%',\n // railOpacity: 0.9\n // });\n\n // });\n // }\n // };\n // }\n // **/\n // /**\n // * slimScroll - Directive for slimScroll with custom height\n // */\n // /**\n // function slimScroll($timeout){\n // return {\n // restrict: 'A',\n // scope: {\n // boxHeight: '@'\n // },\n // link: function(scope, element) {\n // $timeout(function(){\n // element.slimscroll({\n // height: scope.boxHeight,\n // railOpacity: 0.9\n // });\n\n // });\n // }\n // };\n // }\n // **/\n // /**\n // * clockPicker - Directive for clock picker plugin\n // */\n // function clockPicker() {\n // return {\n // restrict: 'A',\n // link: function(scope, element) {\n // element.clockpicker();\n // }\n // };\n // };\n\n\n // /**\n // * landingScrollspy - Directive for scrollspy in landing page\n // */\n // function landingScrollspy() {\n // return {\n // restrict: 'A',\n // link: function(scope, element, attrs) {\n // element.scrollspy({\n // target: '.navbar-fixed-top',\n // offset: 80\n // });\n // }\n // }\n // }\n\n // /**\n // * fitHeight - Directive for set height fit to window height\n // */\n // function fitHeight() {\n // return {\n // restrict: 'A',\n // link: function(scope, element) {\n // element.css(\"height\", $(window).height() + \"px\");\n // element.css(\"min-height\", $(window).height() + \"px\");\n // }\n // };\n // }\n\n // /**\n // * truncate - Directive for truncate string\n // */\n // function truncate($timeout) {\n // return {\n // restrict: 'A',\n // scope: {\n // truncateOptions: '='\n // },\n // link: function(scope, element) {\n // $timeout(function() {\n // element.dotdotdot(scope.truncateOptions);\n\n // });\n // }\n // };\n // }\n\n\n // /**\n // * touchSpin - Directive for Bootstrap TouchSpin\n // */\n // function touchSpin() {\n // return {\n // restrict: 'A',\n // scope: {\n // spinOptions: '='\n // },\n // link: function(scope, element, attrs) {\n // scope.$watch(scope.spinOptions, function() {\n // render();\n // });\n // var render = function() {\n // $(element).TouchSpin(scope.spinOptions);\n // };\n // }\n // }\n // };\n\n // /**\n // * markdownEditor - Directive for Bootstrap Markdown\n // */\n // function markdownEditor() {\n // return {\n // restrict: \"A\",\n // require: 'ngModel',\n // link: function(scope, element, attrs, ngModel) {\n // $(element).markdown({\n // savable: false,\n // onChange: function(e) {\n // ngModel.$setViewValue(e.getContent());\n // }\n // });\n // }\n // }\n // };\n\n // function categoryName(categoryService) {\n // return {\n // restrict: 'AE',\n // replace: true,\n // scope: {\n // id: '@'\n // },\n // template: '{{category.name}}',\n // link: function(scope, elem) {\n // categoryService.getById(scope.id).then(function(response){\n // scope.category = response;\n // });\n // }\n // }\n // }\n\n // function categorySelect(categoryService) {\n // return {\n // replace: true,\n // restrict: 'E',\n // scope: {\n // selectedCategoryId: '='\n // },\n // template:\n // '',\n // link: function(scope, elem) {\n // categoryService.getAll(1000, 1, '+name').then(function(response) {\n // if (response.data) {\n // scope.categories = response.data;\n // }\n // });\n // }\n // }\n // }\n\n // function categoryToggle(categoryService) {\n // return {\n // replace: false,\n // restrict: 'E',\n // scope: {\n // categories: '=',\n // onChange: '='\n // },\n // template:\n // '' +\n // '' +\n // '',\n // controller: function($scope) {\n // categoryService.getAll(1000, 1, '+name').then(function(response) {\n // if (response.data) {\n // $scope.categories = response.data;\n // // fire change handler once with all categories for default state\n // $scope.onChange($scope.categories);\n // }\n // });\n // $scope.onClick = function() {\n // $scope.onChange($scope.categories.filter(function(c) { return c.selected === true }));\n // }\n // }\n // }\n // }\n\n\n\n /**\n * topNavCollapse - Directive to collapse and change look of header navbar on scroll\n */\n function topNavCollapse($window) {\n //console.log('topNavCollapse');\n return function(scope, element, attrs) {\n angular.element($window).bind(\"scroll\", function() {\n if (this.pageYOffset >= 75) {\n scope.boolChangeClass = true;\n //console.log('Scrolled below header.');\n } else {\n scope.boolChangeClass = false;\n //console.log('Header is in view.');\n }\n scope.$apply();\n });\n };\n };\n\n})();\n\n/**\n *\n * Main directives.js file\n * Define directives for used plugin\n *\n *\n * Functions (directives)\n * - sideNavigation\n * - iboxTools\n * - minimalizaSidebar\n * - vectorMap\n * - sparkline\n * - icheck\n * - ionRangeSlider\n * - dropZone\n * - responsiveVideo\n * - chatSlimScroll\n * - customValid\n * - fullScroll\n * - closeOffCanvas\n * - clockPicker\n * - landingScrollspy\n * - fitHeight\n * - iboxToolsFullScreen\n * - slimScroll\n * - truncate\n * - touchSpin\n * - markdownEditor\n * - resizeable\n *\n */\n\n(function() {\n 'use strict';\n\n angular\n .module('main')\n .controller('MainController', MainController);\n\n function MainController($log, $scope, overflowSubjectService, $state, $rootScope, $location, $stateParams, $http, ENV_VARS) {\n var vm = this;\n\n vm.isSidebarOpened = false;\n //////////////////////\n // GLOBAL ENV VARS\n //////////////////////\n\n // app name from gulp file json\n $rootScope.appName = ENV_VARS.appName;\n\n // app name from gulp file json\n $rootScope.appDesc = ENV_VARS.appDesc;\n\n\n ///////////////////////////////\n // BODY ID - CSS IDENTIFIER\n ///////////////////////////////\n vm.bodyId = '';\n // set unique id on body tag for any state we specify in routes files\n $scope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {\n\n //$log.debug(\"main.controller: event\", event);\n\n // SET CLASS\n if (toState.data && toState.data.bodyClass) {\n vm.bodyClass = toState.data.bodyClass;\n } else {\n vm.bodyClass = '';\n }\n\n if (toState.name) {\n vm.bodyId = toState.name;\n } else {\n vm.bodyId = '';\n }\n });\n\n overflowSubjectService.subscribe(function(isSidebarOpened) {\n vm.isSidebarOpened = isSidebarOpened;\n });\n\n }\n\n})();\n(function() {\n 'use strict';\n\n angular\n .module('app', [\n // vendor\n 'ngAnimate',\n 'ngTouch',\n 'ngSanitize',\n 'ngMessages',\n 'ngMeta',\n 'ui.router',\n 'ui-notification',\n 'ui.utils.masks',\n 'mgcrea.ngStrap',\n 'ui.bootstrap',\n 'angular-click-outside',\n 'ngScrollbars',\n 'ngFileUpload',\n 'rzModule', \n 'angulartics.google.analytics',\n 'angulartics.google.tagmanager',\n // setup\n 'app.env',\n 'app.directives',\n 'app.components',\n 'app.filters',\n 'app.services',\n // main\n 'main',\n 'home',\n 'checkout'\n ]);\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app')\n .run(runBlock);\n\n function runBlock($log, $http, $rootScope, $state, $stateParams, Notification, ngMeta, $location, $window) {\n\n $rootScope.$on('$stateChangeStart', function(event, toState, toParams, fromState, fromParams) {\n if (toState.external) {\n event.preventDefault();\n $window.open(toState.customUrl, '_self');\n }\n else if (toState.redirectTo) {\n event.preventDefault();\n $state.go(toState.redirectTo, toParams, {location: 'replace'})\n }\n });\n\n // seo - meta tags\n ngMeta.init();\n\n // header partial switcher\n $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) {\n\n //$log.debug(\"toState.name\", toState.name);\n $rootScope.headerPartial = 'app/main/main-header.view.html';\n $rootScope.headerInverseToggle = \"\";\n\n\n // PARDOT MESSAGING HANDLING\n // get query string\n // var queryParams = $location.search();\n // // bake the from state for form control\n // queryParams.fromState = toState.name;\n\n // // look for pardot specific messaging\n // if (queryParams.errorMessage) {\n // $log.debug('REDIRECT TO PARDOT STATE');\n // $state.go('pardot', {pardotParams: queryParams});\n // //$log.debug('queryParams', queryParams);\n // }\n\n\n\n // full header switchout\n if ((toState.name==\"blog\") ||\n (toState.name==\"blog.detail\"))\n {\n $rootScope.headerPartial = 'app/main/company/blog/blog-header.view.html';\n }\n\n // header inverse switch -- now doing this through straight css - class 'staycollapsed'\n // if ((toState.name==\"privacy\") ||\n // (toState.name==\"openings.detail\") ||\n // (toState.name==\"news.detail\") ||\n // (toState.name==\"press\") ||\n // (toState.name==\"tos\") ||\n // (toState.name==\"pousi\"))\n\n // {\n // $rootScope.headerInverseToggle = \"top-nav-collapse\";\n // }\n });\n\n }\n\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app')\n .config(routeConfig);\n\n function routeConfig($stateProvider, $urlRouterProvider, $urlMatcherFactoryProvider) {\n $urlMatcherFactoryProvider.strictMode(false);\n\n $stateProvider\n\n //////////////////////\n // MAIN\n //////////////////////\n\n .state('main', {\n abstract: true,\n url: \"/\",\n templateUrl: \"app/main/main.view.html\",\n controller: 'MainController',\n controllerAs: 'vm',\n data: {\n bodyId: 'main'\n }\n })\n\n .state('home', {\n parent: 'main',\n url: \"\",\n templateUrl: \"app/main/home/home.view.html\",\n controller: 'HomeController',\n controllerAs: 'vm',\n data: {\n meta: {\n 'title': 'OrangePiel Design Studio - Custom Printed Window Shades',\n 'description': 'OrangePiel Design Studio - Custom Printed Window Shades. OrangePiel is a full-service design and technology company that helps customers create custom printed window shades and custom printed acoustical murals. We work with everyone from individuals to Fortune 100 companies to add custom printed decor to their environment.',\n }\n }\n })\n\n .state('checkout', {\n parent: 'main',\n url: \"checkout\",\n templateUrl: \"app/main/checkout/checkout.view.html\",\n controller: 'CheckoutController',\n controllerAs: 'vm',\n data: {\n meta: {\n 'title': 'Checkout | OrangePiel Custom Printed Window Shades',\n 'description': 'OrangePiel Design Studio - Custom Printed Window Shades. OrangePiel is a full-service design and technology company that helps customers create custom printed window shades and custom printed acoustical murals. We work with everyone from individuals to Fortune 100 companies to add custom printed decor to their environment.',\n }\n }\n })\n\n .state('cart', {\n parent: 'main',\n url: \"cart/:id\",\n templateUrl: \"app/main/cart/cart.view.html\",\n controller: 'CartController',\n controllerAs: 'vm',\n data: {\n meta: {\n 'title': 'Cart | OrangePiel Custom Printed Window Shades',\n 'description': 'OrangePiel Design Studio - Custom Printed Window Shades. OrangePiel is a full-service design and technology company that helps customers create custom printed window shades and custom printed acoustical murals. We work with everyone from individuals to Fortune 100 companies to add custom printed decor to their environment.',\n }\n }\n })\n }\n\n})();\n\nangular.module(\"app.env\", [])\n.constant(\"ENV_VARS\", {\n \"appName\": \"OrangePiel (Production)\",\n \"appDesc\": \"\",\n \"apiUrl\": \"https://api.orangepiel.com/\",\n \"debug\": \"false\",\n \"version\": \"0.0.1\",\n \"stripeKey\": \"pk_MoJAMxc9NBxTUK8VgXvWavvd0Vt2O\"\n})\n.constant(\"AWS_S3_UPLOAD\", {\n \"AWSAccessKeyId\": \"AKIAVSK2676HTM6F5YHK\",\n \"policy\": \"ewogICJleHBpcmF0aW9uIjogIjIwNTAtMDEtMDFUMDA6MDA6MDBaIiwKICAiY29uZGl0aW9ucyI6IFsKICAgIHsiYnVja2V0IjogImNkbi1vcmFuZ2VwaWVsMiJ9LAogICAgWyJzdGFydHMtd2l0aCIsICIka2V5IiwgIiJdLAogICAgeyJhY2wiOiAicHVibGljLXJlYWQifSwKICAgIFsic3RhcnRzLXdpdGgiLCAiJENvbnRlbnQtVHlwZSIsICIiXSwKICAgIFsic3RhcnRzLXdpdGgiLCAiJGZpbGVuYW1lIiwgIiJdLAogICAgWyJjb250ZW50LWxlbmd0aC1yYW5nZSIsIDAsIDUyNDI4ODAwMF0KICBdCn0=\",\n \"signature\": \"f2k7X3znKrcb8RhNqzkHzs1YHbo=\",\n \"s3url\": \"https://cdn-orangepiel2.s3.amazonaws.com/\"\n});\n\n(function() {\n 'use strict';\n\n angular.module('app').factory('API', function(ENV_VARS) {\n // controlled from /config/app.env-vars.json file\n var base = ENV_VARS.apiUrl;\n return {\n ORDERS: base + 'api/orders',\n CONTACT: base + 'api/contact',\n };\n });\n})();\n\n(function() {\n 'use strict';\n\n angular\n .module('app')\n .config(config);\n\n function config($logProvider, $locationProvider, $httpProvider, $analyticsProvider, ScrollBarsProvider, $modalProvider, $provide, ENV_VARS) {\n\n // LOGGING (turn on/off globally)\n if (ENV_VARS.debug == \"true\") {\n $logProvider.debugEnabled(true);\n }\n else {\n $logProvider.debugEnabled(false);\n }\n\n // CLEAN URLS\n $locationProvider.hashPrefix('!');\n $locationProvider.html5Mode({ enabled: true, requireBase: false });\n\n ScrollBarsProvider.defaults = {\n scrollInertia: 100, \n setHeight: true,\n };\n\n // ANGULAR STRAP MODAL DEFAULTS\n angular.extend($modalProvider.defaults, {\n html: true\n });\n\n // ANGULARTICS\n $analyticsProvider.settings.ga = {\n additionalAccountNames: undefined,\n additionalAccountHitTypes: {\n pageview: true,\n event: true,\n exception: false,\n ecommerce: false,\n userTiming: false,\n setUserProperties: false,\n userId: false\n },\n disableEventTracking: null,\n disablePageTracking: null,\n enhancedEcommerce: false, \n transport: null,\n userId: null\n };\n }\n\n})();\n\nangular.module(\"app\").run([\"$templateCache\", function($templateCache) {$templateCache.put(\"app/main/main-404.view.html\",\"

404: Page Not Found

\");\n$templateCache.put(\"app/main/main-footer.view.html\",\"\");\n$templateCache.put(\"app/main/main-header.view.html\",\"
\\\"\\\"
\");\n$templateCache.put(\"app/main/main.view.html\",\"
\");\n$templateCache.put(\"app/main/checkout/checkout.view.html\",\"

Checkout

  • Size: {{ vm.orderMetadata.width }} {{ vm.orderMetadata.widthFraction }} x {{ vm.orderMetadata.height }} {{ vm.orderMetadata.heightFraction }}
  • {{ vm.orderMetadata.fabric }}
  • Fascia ({{ vm.orderMetadata.fascia }})
  • {{ vm.getMotorization() }}
  • {{ vm.orderMetadata.mounting }}
  • {{ vm.orderMetadata.imageOrientation }}
  • {{ vm.orderMetadata.rollType }}
  • Chain on {{ vm.orderMetadata.controlPosition }}
  • {{ vm.orderMetadata.controlColor }} Chain
Edit shade Remove shade

SHIPPING ADDRESS

PAYMENT INFO

\\\"\\\"

ORDER DETAILS

$ {{ vm.orderCost | number: 2 }}
  • Shipping: FREE
  • Taxes: ${{ (vm.totalOrderCost - vm.orderCost) | number: 2 }}
$ {{ vm.totalOrderCost | number: 2 }}
\");\n$templateCache.put(\"app/main/home/home.view.html\",\"
\");\n$templateCache.put(\"app/common/components/dropdown/dropdown.component.html\",\"
{{ vm.getCurrentValue() }}
  • {{ option.label }}
\");\n$templateCache.put(\"app/main/checkout/address/address.component.html\",\"
\");\n$templateCache.put(\"app/main/home/image-upload/image-upload.component.html\",\"

Click to upload your artwork!

\");\n$templateCache.put(\"app/main/home/order-modal/order-modal.view.html\",\"

Your Order is processing. It may take a few seconds to complete.

Orders usually ship within 2-3 weeks. If you have any questions please call us at 888.280.2271 or email at finepeople@orangepiel.com.

  • Size: {{ vm.orderMetadata.width }} {{ vm.orderMetadata.widthFraction }} x {{ vm.orderMetadata.height }} {{ vm.orderMetadata.heightFraction }}
  • {{ vm.orderMetadata.fabric }} Fabric
  • Fascia ({{ vm.orderMetadata.fascia }})
  • {{ vm.getMotorization() }}
  • {{ vm.orderMetadata.mounting }} Mount
  • {{ vm.orderMetadata.imageOrientation }}
  • {{ vm.orderMetadata.rollType }} Roll
  • Chain on {{ vm.orderMetadata.controlPosition }}
  • {{ vm.orderMetadata.controlColor }} Chain

Order received! We will review your order and confirm that everything looks good.

Orders usually ship within 2-3 weeks. If you have any questions please call us at 888.280.2271 or email at finepeople@orangepiel.com.

  • Size: {{ vm.orderMetadata.width }}”x {{ vm.orderMetadata.height }}”
  • {{ vm.orderMetadata.fabric }} Fabric
  • Fascia ({{ vm.orderMetadata.fascia }})
  • {{ vm.getMotorization() }}
  • {{ vm.orderMetadata.mounting }} Mount
  • {{ vm.orderMetadata.imageOrientation }}
  • {{ vm.orderMetadata.rollType }} Roll
  • Chain on {{ vm.orderMetadata.controlPosition }}
  • {{ vm.orderMetadata.controlColor }} Chain

Uh oh… Looks like something went wrong. Please try your order again.

If you continue to have issues please call us at 888.280.2271 or email at finepeople@orangepiel.com.

  • Size: {{ vm.orderMetadata.width }}”x {{ vm.orderMetadata.height }}”
  • {{ vm.orderMetadata.fabric }} Fabric
  • Fascia ({{ vm.orderMetadata.fascia }})
  • {{ vm.getMotorization() }}
  • {{ vm.orderMetadata.mounting }} Mount
  • {{ vm.orderMetadata.imageOrientation }}
  • {{ vm.orderMetadata.rollType }} Roll
  • Chain on {{ vm.orderMetadata.controlPosition }}
  • {{ vm.orderMetadata.controlColor }} Chain
\");\n$templateCache.put(\"app/main/home/roller/roller.component.html\",\"
\");\n$templateCache.put(\"app/main/home/studio/studio.component.html\",\"

Design Studio

\\\"\\\" Printed Window Shades
\\\"\\\" Fine Art Printing
\\\"\\\" Custom Wallpaper
{{ vm.orderMetadata.width }}” {{ vm.orderMetadata.height }}”

Uploading and processing your artwork...

Please be patient.

100%200%
Width (in)
Length (in)
$ {{ vm.orderCost | number: 2 }}

{{ item.disabledMessage }}

$ {{ vm.orderCost | number: 2 }}
\");\n$templateCache.put(\"app/main/home/modals/views/chain-color.view.html\",\"
Close

CHAIN COLORS

Choose the color of the chain that controls your window shade.

Features

  • Available in white, black, or stainless steel to go with any decor.
  • White and black are comprised of a continuous nylon cord with thermally fused plastic beads along its length.
  • White and black have 50lbs of tensile strength.
  • Stainless steel has 90lbs of tensile strength.
  • For flexibility, the spacing of the beads on a plastic beaded chain are typically twice that of a metal beaded chain.
White
Black
Stainless Steel

More Questions?

888.454.8724 finepeople@orangepiel.com

Have someone call me!

\");\n$templateCache.put(\"app/main/home/modals/views/chain-position.view.html\",\"
Close

CHAIN POSITION

The chain is used to raise or lower your window shade.

Left Side

When looking outside from room.

Right Side

When looking outside from room.

More Questions?

888.454.8724
finepeople@orangepiel.com

Have someone call me!

\");\n$templateCache.put(\"app/main/home/modals/views/fabric-style.view.html\",\"
Close

FABRIC STYLE

Sheer-Weave Fabric

Let the sun in. See through your shade.
  • Provides 97 percent UV protection, while preserving your view of the outdoors.
  • Protects interiors from harmful UV rays and reduces glare.
  • GREENGUARD Gold Certified.
  • Contains Microban antimicrobial additives to resist mold and fungus.

Backlit Fabric

Backlight your shade, with privacy. Nobody sees-through.
  • Classic, lightweight translucent material that is as beautiful as it is functional.
  • Filters natural light, while still allowing magnificent illumination of your interior space.
  • Energy saving and certified to GREENGUARD Gold standards.
  • Bacteria and fungal resistant.
  • PVC-composition free.

Blackout Fabric

Keep wandering eyes and sunlight out. Completely dark.
  • Uniquely designed to provide total light blockage, while still maintaining an elegant, soft finish.
  • Provides complete privacy.
  • Energy saving and certified to GREENGUARD Gold standards.
  • Bacteria and fungal resistant.
  • PVC-composition free.

More Questions?

888.454.8724 finepeople@orangepiel.com

Have someone call me!

\");\n$templateCache.put(\"app/main/home/modals/views/fascia.view.html\",\"
Close

FASCIA OPTIONS

Decorative aluminum shade cover used to hide shade roller and control mechanisms.

Features

  • Covers the roller of your window treatment for a cleaner look.
  • Conceals control mechanism.
  • Metal fascia available in black, white, or anodized aluminum.
  • 3\\\" fascia height for shades shorter than 6\\' wide.
  • 4\\\" fascia height for shades 6\\' and longer.

More Questions?

888.454.8724 finepeople@orangepiel.com

Have someone call me!

White
Black
Aluminum
\");\n$templateCache.put(\"app/main/home/modals/views/help-modal.view.html\",\"
Close

IMAGE ORIENTATION

Interior Facing

Printed side of shade faces AWAY from the window glass
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  • Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.

Exterior Facing

Printed side of shade faces TOWARDS from the window glass
  • Lorem ipsum dolor sit amet, consectetur adipiscing elit.
  • Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
  • Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Installation Instructions

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris

FAQs

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure

More Questions?

888.454.8724 finepeople@orangepiel.com

Have someone call me!

The contact request has been created.

\");\n$templateCache.put(\"app/main/home/modals/views/image-orientation.view.html\",\"
Close

IMAGE ORIENTATION

Simply put, the image orientation refers to which direction you want your image to face. An interior facing orientation will face inside the room. This orientation allows you to admire your window treatment from inside your home or office. An exterior facing orientation will face the window and be seen from the outside.

Interior Facing

Printed side of shade faces AWAY from the window glass.
  • Printed side of shade faces AWAY from window glass.
  • Perfect for creating a unique environment inside your home or office.

Exterior Facing

Printed side of shade faces TOWARDS the window glass.
  • Printed side faces towards the outside
  • Perfect for storefronts looking to make a statement to the outside.

Frequently Asked Questions

What is the quality of the printed image?

Our fine art lineage makes OrangePiel a stickler for all things printed. If we wouldn\\'t be proud to hang, install it, or show it off in our own home, we won\\'t let it out of our site. With printing up to 1080 DPI, every print will be beautiful. Our UV Printing technology ensures your print will never fade.

More Questions?

888.454.8724 finepeople@orangepiel.com

Have someone call me!

\");\n$templateCache.put(\"app/main/home/modals/views/motor-position.view.html\",\"
Close

MOTOR POSITION

The motor is used to raise and lower your window shade.

Left Side

When looking outside from room.

Right Side

When looking outside from room.

More Questions?

888.454.8724 finepeople@orangepiel.com

Have someone call me!

\");\n$templateCache.put(\"app/main/home/modals/views/motorization.view.html\",\"
Close

MOTORIZATION OPTIONS

Battery Operated

Features the innovative Somfy R28 WireFree Motor.
  • Quick and easy to install.
  • Completely wireless - no need for an electrician.
  • Fits into hard-to-reach window coverings, providing the perfect solution for areas where access to wiring may be a challenge.
  • “My” feature allows you to set a preferred position for your window treatment, so your favorite setting is one button press away.

Hardwired

Features Somfy Sonesse 50 QUIET motor with smooth and silent movement.
  • Noise and vibration are absorbed into the motor to ensure high quality acoustic performance.
  • Provides aesthetically pleasing solutions for almost any interior installation.
  • Compatible with Radio Technology Somfy (RTS), including hand-held remotes, smartphone & tablet apps, wireless wall switches, table top controls, sensors, timers, and third-party automation systems.
  • Offers control via power switching.

Wireless Hand Held Remote

Omnidirectional, no need to aim the remote as it operates within a range of 65 ft.
  • Radio waves travel through walls, allowing you to adjust your window treatment from another room.
  • Simple programming makes it easy to change your preferences at any time.
  • Timer allows you to schedule your motorized shades to open and close automatically at your desired time.

Wireless Wall Mount Remote

Personalizable battery powered wall switch.
  • Features RTS technology.
  • No wiring required, which means no need for an electrician.
  • Easy to use and program.
  • Can be converted from one up to five channel buttons, depending on how many window coverings you want to control.
  • Available in three colors - black, white, or ivory.

More Questions?

888.454.8724 finepeople@orangepiel.com

Have someone call me!

\");\n$templateCache.put(\"app/main/home/modals/views/mounting-options.view.html\",\"
Close

MOUNTING STYLE

Outside Mount

Shade mounted outside and above window box.
  • Perfect when you need flexibility or for uniquely shaped windows.
  • Window treatment will extend past the window box.
  • Can make small windows appear larger because it gives you the ability to control how wide or how tall the window treatment is and where it is placed on the wall.
  • Great for layering window treatments or for shallow window frames.

Inside Mount

Shade mounted inside window box.
  • Perfect for when you want a clean, built-in look.
  • Can be mounted as deep or shallow as you want, with a minimum depth of 2\\\".
  • Least impact on woodwork and window frame details.
  • Great for small spaces or when you want to highlight decorative trim.

Frequently Asked Questions

I want a really clean look. Which mounting style will help me achieve this?

An inside mount will provide you with the cleanest look because the roll will sit inside of your window frame and can be mounted as shallow or deep as you’d like.

My window frame is very shallow. Which mounting style will work best for me?

For window frames with a depth of less than 2\\\", we suggest an outside mount, because there won’t be enough space to securely mount inside the frame.

My window frame is very deep. Which mounting style will work best for me?

If you have a deep window frame, an inside mount will give you the most versatility because the shade will sit closer to the window, leaving space on the sill.

How can I make my small window appear bigger?

An outside mount can enlarge the appearance of a small window, because the shade itself will be larger than the width of the window and you can choose where the window treatment is placed on the wall.

Privacy and/or blocking light is a concern for me. Which mounting style should I choose?

If privacy or blocking light are a concern, an outside mount will be the best choice because the shade will overlap the edge of the window, removing the gap created from the hardware of an inside mount.

More Questions?

888.454.8724 finepeople@orangepiel.com

Have someone call me!

\");\n$templateCache.put(\"app/main/home/modals/views/roll-type.view.html\",\"
Close

ROLL TYPE

Reverse Roll

Fabric falls off the FRONT of the roll.
  • Roll is concealed when shade is drawn, providing a sleek, minimalist look.
  • Allows clearance for door handles or windows with cranks.
  • Creates a gap between the window treatment and the window, allowing more light through than a regular roll.

Regular Roll

Fabric falls off the BACK of the roll.
  • Allows fabric to sit close to the window.
  • Best choice for inside mounting.
  • Allows slightly less light through than reverse roll.

Frequently Asked Questions

Which roll type should I choose if I have decorative hardware?

If you want to keep your decorative hardware visible, regular roll is the way to go.

Which roll type is best with an inside mount and shallow depth?

Regular roll is best with an inside mount, because the shade sits next to the window instead of protruding out into the room.

Which roll type is best if I want to block the most light possible when the shade is drawn?

Since the regular roll sits next to the glass, this will be your best option. Reverse roll will leave a gap between the window and the shade.

Privacy is a concern to me. Which roll type is best?

Regular roll is best if privacy is a concern, since it allows the shade to sit flush next to the window.

My window shade is going on a door or window with a crank. What is the best roll type for this situation?

Reverse roll would be best, because the fabric falls off the front of the shade, creating a gap between the shade and the window to clear the hardware.

I want to conceal the roll of the shade for a sleeker look. Which roll type is best?

Reverse roll would be best, because the fabric falls off the front of the shade, covering the roll.

More Questions?

888.454.8724 finepeople@orangepiel.com

Have someone call me!

\");\n$templateCache.put(\"app/main/home/modals/views/size.view.html\",\"
Close

SIZING AND MEASUREMENT

Tools

  • Measuring tape
  • Pencil
  • Paper

Things to Remember

  • Measure the exact window intended for the treatment.
  • Measure to the nearest 1/8\\\".
  • Do not take any deductions for clearance. OrangePiel will determine necessary deductions.
  • Double check your measurements, precision pays!

Consider Mounting Style

Depending on what mounting style best fits your project, the instructions will be slightly different.

Inside Mount

Shade mounted inside window box.
  1. Measure the width inside the window opening at the top, middle, and bottom. Use the narrowest measurement as your \\\"Width\\\".
  2. Measure height inside the window opening at the left, right, and center. Use the longest measurement as your \\\"Height\\\".

Outside Mount

Shade mounted outside and above window box.
  1. Measure the desired width. To minimize light leakage, the shade should overlap the window opening at least 2\\\" on each side. Use this measurement as \\\"Width\\\".
  2. Measure the desired height. Allow for enough space for mounting brackets above the window (3\\\") and enough overlap at the bottom to avoid a light gap. Use this measurement as \\\"Height\\\".

More Questions?

888.454.8724 finepeople@orangepiel.com

Have someone call me!

\");\n$templateCache.put(\"app/main/home/popups/customizable-popup/customizable-popup.component.html\",\"

SIGN UP TO KNOW FIRST

Be the first to know when {{ vm.type }} is ready for customization.

The message has been sent.

\");\n$templateCache.put(\"app/main/home/popups/replace-popup/replace-popup.component.html\",\"

Warning

Are you sure? You will lose all current design progress

\");}]);"],"sourceRoot":"/source/"}