{"version":3,"sources":["widgets/profile/lady/interview/main.es6.js"],"names":["create","container","ladyId","profilePromise","Promise","api","ladies","get","err","data","resolve","tmplPromise","templates","tpl","textPromise","texts","all","then","profileModel","values","interview","length","localization","interviewListShort","slice","ladyNameLocalized","name","headerText","replace","append","render"],"mappings":";;;;YAMgBA,M,GAAAA,M;;;;;;;;;;;;;;;;;;AAAT,aAASA,MAAT,CAAgBC,SAAhB,EAA2BC,MAA3B,EAAmC;AACtC,YAAIC,iBAAiB,IAAIC,OAAJ,CAAY,mBAAW;AACxCC,0BAAIC,MAAJ,CAAWC,GAAX,CAAeL,MAAf,EAAuB,UAASM,GAAT,EAAcC,IAAd,EAAmB;AACtCC,wBAAQD,IAAR;AACH,aAFD;AAGH,SAJoB,CAArB;AAKA,YAAIE,cAAc,IAAIP,OAAJ,CAAY,mBAAW;AACrCQ,gCAAUL,GAAV,CAAc,mBAAd,EAAmC,UAAUC,GAAV,EAAeK,GAAf,EAAoB;AACnDH,wBAAQG,GAAR;AACH,aAFD;AAGH,SAJiB,CAAlB;;AAMA,YAAIC,cAAc,IAAIV,OAAJ,CAAY,mBAAW;AACrCC,0BAAIU,KAAJ,CAAUR,GAAV,CAAc,WAAd,EAA2B,UAASC,GAAT,EAAcC,IAAd,EAAmB;AAC1CC,wBAAQD,IAAR;AACH,aAFD;AAGH,SAJiB,CAAlB;;AAMAL,gBAAQY,GAAR,CAAY,CAACb,cAAD,EAAgBQ,WAAhB,EAA6BG,WAA7B,CAAZ,EAAuDG,IAAvD,CAA4D,kBAAU;AAClE,gBAAIC,eAAeC,OAAO,CAAP,CAAnB;AACA,gBAAGD,aAAaE,SAAb,IAA0BF,aAAaE,SAAb,CAAuBC,MAAvB,GAAgC,CAA7D,EAA+D;AAC3D,oBAAIR,MAAMM,OAAO,CAAP,CAAV;AACA,oBAAIG,eAAgBH,OAAO,CAAP,CAApB;AACAD,6BAAaK,kBAAb,GAAkCL,aAAaE,SAAb,CAAuBI,KAAvB,CAA6B,CAA7B,EAA+B,CAA/B,CAAlC;AACA,oBAAIC,oBAAuBP,aAAaQ,IAApC,QAAJ;AACAR,6BAAaS,UAAb,GAA0B,CAACL,aAAa,kBAAb,KAAoC,EAArC,EAAyCM,OAAzC,CAAiD,KAAjD,EAAwDH,iBAAxD,CAA1B;AACAxB,0BAAU4B,MAAV,CAAiBhB,IAAIiB,MAAJ,CAAWZ,YAAX,CAAjB;AACH;AAEJ,SAXD;AAYH","file":"widgets/profile/lady/interview/main.js","sourceRoot":"/source/","sourcesContent":["import api from 'api';\r\nimport templates from 'modules/templates';\r\nimport photoRepo from 'repositories/ladies';\r\nimport bodyTypeConvertor from 'modules/body-type/convertor';\r\nimport config from 'config';\r\n\r\nexport function create(container, ladyId) {\r\n let profilePromise = new Promise(resolve => {\r\n api.ladies.get(ladyId, function(err, data){\r\n resolve(data);\r\n });\r\n });\r\n let tmplPromise = new Promise(resolve => {\r\n templates.get('profile-interview', function (err, tpl) {\r\n resolve(tpl);\r\n })\r\n });\r\n\r\n let textPromise = new Promise(resolve => {\r\n api.texts.get('lady/card', function(err, data){\r\n resolve(data);\r\n });\r\n });\r\n\r\n Promise.all([profilePromise,tmplPromise, textPromise]).then(values => {\r\n var profileModel = values[0];\r\n if(profileModel.interview && profileModel.interview.length > 0){\r\n var tpl = values[1];\r\n var localization = values[2];\r\n profileModel.interviewListShort = profileModel.interview.slice(0,2);\r\n var ladyNameLocalized = `${profileModel.name}'s`;\r\n profileModel.headerText = (localization['interview-format'] || '').replace('{0}', ladyNameLocalized);\r\n container.append(tpl.render(profileModel));\r\n }\r\n\r\n });\r\n}"]}