{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./frontend/js/admin.js","webpack:///./frontend/js/data/data.js","webpack:///./frontend/js/data/index.js","webpack:///./frontend/js/libs/vuex.js","webpack:///(webpack)/buildin/global.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;AClFA;AAAA;AAA2B;AAC3B;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,gBAAgB,oDAAK;AACrB;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC;AACnC;AACA;AACA;AACA;AACA;AACA,oCAAoC;AACpC;AACA;AACA;AACA;AACA;AACA,uCAAuC;AACvC,uCAAuC;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC;AACtC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA,yBAAyB;;AAEzB;AACA;AACA;AACA,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,4DAA4D;AAC5D;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA,qBAAqB;AACrB,iBAAiB;;AAEjB;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,iBAAiB;;AAEjB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;;AAEA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;;AAEpE;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,qBAAqB;;AAErB;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,2CAA2C,oBAAoB;AAC/D;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,6BAA6B;AAC7B,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;;AAEzB;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;AACzB,qBAAqB;;AAErB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA,yCAAyC;AACzC;AACA,iCAAiC;AACjC,6BAA6B;AAC7B;AACA;AACA,iCAAiC;AACjC;AACA,yBAAyB;AACzB;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA,iCAAiC;AACjC,6BAA6B;AAC7B;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA,6FAA6F,GAAG;AAChG;;AAEA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA,qCAAqC,8CAA8C;;AAEnF,yBAAyB;AACzB;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;;AAErB;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA,yCAAyC;AACzC;AACA;AACA,yCAAyC;;;AAGzC;AACA;AACA,6CAA6C;;AAE7C;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yDAAyD;AACzD,qDAAqD;;AAErD,iDAAiD;;AAEjD;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA,yBAAyB;;;AAGzB;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;;AAGA,kFAAkF,aAAa;AAC/F;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,oGAAoG,OAAO;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE;;AAEpE;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,qCAAqC;AACrC;AACA,6BAA6B;AAC7B,yBAAyB;AACzB;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,yBAAyB;AACzB;AACA;AACA,6BAA6B;AAC7B;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,SAAS;AAC5D;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,yDAAyD;AACzD;;AAEA;AACA;;AAEA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA,qBAAqB;;;AAGrB;AACA;AACA;AACA;AACA;;AAEA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;;AAEA;;AAEA;AACA,iCAAiC;AACjC;AACA;AACA,6BAA6B;;AAE7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,yCAAyC;AACzC;AACA,iCAAiC;AACjC;AACA;;AAEA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;;AAGrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD;AACjD;AACA;;AAEA;AACA,yCAAyC;AACzC;AACA,mCAAmC;;AAEnC;AACA;AACA,yBAAyB;;AAEzB,sBAAsB;;AAEtB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA,iCAAiC;AACjC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC,EAAE;AACnC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC,EAAE;AACnC;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,iCAAiC;AACjC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iCAAiC;AACjC;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;;AAEA;AACA,6DAA6D,MAAM;AACnE;AACA,6BAA6B;AAC7B;;AAEA;AACA,gEAAgE,MAAM;AACtE;AACA,6BAA6B;AAC7B;;AAEA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;;AAEA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA,sCAAsC;AACtC;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA,0EAA0E;AAC1E;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,gDAAgD;AAChD,yBAAyB;AACzB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qCAAqC;AACrC;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;;AAEzB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iCAAiC;AACjC;AACA;AACA;AACA,yBAAyB;;AAEzB;;AAEA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA,6BAA6B;AAC7B,yBAAyB;;AAEzB;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,mHAAmH,EAAE;AACrH,yBAAyB;AACzB;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,yBAAyB;;AAEzB,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,qBAAqB;;AAErB;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA,2BAA2B,MAAM,WAAW,MAAM;AAClD;AACA,yBAAyB;AACzB,qBAAqB;;AAErB;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,qBAAqB;;AAErB;;AAEA;AACA;AACA;;AAEA;AACA;AACA,sCAAsC,gBAAgB;AACtD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAsB;;AAEtB;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;;;AAGA,6FAA6F,4EAA4E;AACzK;AACA;AACA,iBAAiB;;AAEjB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;;AAEb;AACA,SAAS;AACT,KAAK;AACL,CAAC,U;;;;;;;;;;;;ACtoDD;AAAe;AACf,KAAK,uFAAuF;AAC5F,KAAK,2GAA2G;AAChH,KAAK,6GAA6G;AAClH,KAAK,wGAAwG;AAC7G,KAAK,0GAA0G;AAC/G,KAAK,qGAAqG;AAC1G,KAAK,0FAA0F;AAC/F,KAAK,8FAA8F;AACnG,KAAK,6GAA6G;AAClH,KAAK,6FAA6F;AAClG,C;;;;;;;;;;;;ACXA;AAAA;AAAA;AAAA;AAA+B;AACC;;AAEhC,QAAQ,iDAAI;;AAEG,mEAAI,iDAAI;AACvB;AACA,QAAQ,yDAAU;AAClB;AACA,KAAK;AACL;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT,KAAK;AACL,CAAC,CAAC,E;;;;;;;;;;;ACnBF;AACA;AACA;AACA;AACA;AACA;AACA,IAAI,KAA4D;AAChE,QAAQ,SACsD;AAC9D,CAAC,oBAAoB;;AAErB;AACA;;AAEA;AACA,uBAAuB,yBAAyB;AAChD,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B;;AAE3B;;AAEA;;AAEA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA,eAAe,MAAM;AACrB,eAAe,SAAS;AACxB,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA,iDAAiD,0BAA0B,EAAE;AAC7E;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,yBAAyB;AACzB;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,8BAA8B,cAAc,qBAAqB;;AAEjE;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;;AAEA;AACA;AACA;AACA,4CAA4C;;AAE5C;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,kCAAkC,oCAAoC,EAAE;AACxE;AACA;;AAEA;AACA,kCAAkC;AAClC,+EAA+E,EAAE;AACjF;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,kCAAkC;;AAElC;;AAEA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,YAAY;;AAEZ;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,sCAAsC;AACtC,oCAAoC;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2CAA2C,uBAAuB,EAAE;;AAEpE;AACA;AACA;AACA;AACA;;AAEA,gCAAgC,SAAS,qBAAqB;;AAE9D;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT,kDAAkD,oCAAoC,EAAE;;AAExF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,sBAAsB;AACtB;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,wCAAwC,mBAAmB,EAAE;AAC7D,yCAAyC,yCAAyC,EAAE;AACpF,SAAS;AACT;AACA;AACA;AACA;AACA;;AAEA;AACA,wDAAwD,yBAAyB,EAAE;AACnF;;AAEA;AACA;AACA;AACA,4CAA4C,kBAAkB,EAAE;AAChE,6CAA6C,wCAAwC,EAAE;AACvF,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA,+CAA+C,aAAa;AAC5D;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,mDAAmD,6CAA6C,EAAE;AAClG;;AAEA;AACA;;AAEA;AACA;AACA,SAAS;AACT;;AAEA;AACA;;AAEA,uCAAuC,eAAe;;AAEtD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,uCAAuC,eAAe;;AAEtD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kCAAkC,uBAAuB,EAAE;AAC3D;AACA,aAAa;AACb,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,sCAAsC,yBAAyB,EAAE;AACjE;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;;AAEA;;AAEA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,aAAa;;AAEb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mCAAmC,sBAAsB;AACzD,mCAAmC,2CAA2C;AAC9E,aAAa;AACb;AACA,kCAAkC,0CAA0C;AAC5E;AACA,SAAS;;AAET;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,wDAAwD;;AAExD;AACA;;AAEA;AACA;AACA;AACA;AACA,kCAAkC,4BAA4B,EAAE;AAChE;AACA,aAAa;AACb,SAAS;;AAET;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB,aAAa;AACb;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sCAAsC,4BAA4B;AAClE;AACA;AACA;AACA,SAAS,GAAG,yBAAyB;AACrC;;AAEA;AACA;AACA,iDAAiD,mBAAmB,EAAE;AACtE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA,gBAAgB;AAChB;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,eAAe;AACf;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA,KAAK;;AAEL;AACA;AACA,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA,wDAAwD;AACxD;AACA;AACA;AACA;AACA,KAAK,EAAE;;AAEP;AACA;AACA,qCAAqC,iBAAiB,GAAG,iBAAiB,GAAG,iBAAiB;AAC9F,qBAAqB,iBAAiB,QAAQ,mBAAmB,GAAG,mBAAmB,GAAG,mBAAmB;AAC7G,eAAe,aAAa;AAC5B,gBAAgB;AAChB;AACA;AACA;AACA,sCAAsC,UAAU,qBAAqB,EAAE,EAAE;AACzE,mDAAmD,UAAU,0BAA0B,EAAE,EAAE;AAC3F;;AAEA;AACA;AACA,eAAe,SAAS;AACxB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,eAAe,OAAO;AACtB,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,CAAC,G;;;;;;;;;;;;ACv/BD;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C","file":"bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./frontend/js/admin.js\");\n","import store from './data';\nString.prototype.replaceAll = function (search, replace) {\n return this.split(search).join(replace);\n};\n\n(function ($) {\n $(document).ready(function () {\n if(typeof DatePicker !== \"undefined\")\n Vue.component('date-picker', DatePicker.default);\n\n var iteration = 0;\n $('.ccb-main-calc').each(function () {\n new Vue({\n el: $(this)[0],\n store,\n components: {\n 'sketch-picker': VueColor.Chrome\n },\n data: function () {\n return {\n temp: '',\n date: [],\n order: 0,\n drag: false,\n formula: [],\n tempVal: {},\n load: false,\n settings: [],\n styles: null,\n create: true,\n listings: [],\n response: {},\n fieldId: null,\n extraInfo: [],\n access: false,\n conditions: [],\n calcTotal: [],\n valuesStore: {},\n stmCalcData: {},\n wcProducts: [],\n modalField: '',\n showForm: true,\n oderFields: [],\n removeId: null,\n newIndex: null,\n modalData: null,\n isActive: false,\n projectId: null,\n styleStore: {},\n projectName: '',\n readyFields: [],\n preloader: true,\n navZIndex: true,\n contactForms: [],\n nextButton: true,\n settingsId: null,\n hasAccess: false,\n showTools: false,\n showStripe: false,\n showPayPal: false,\n toolZIndex: false,\n custom_fields: {},\n stmDisplay: false,\n toggleColor: false,\n redirectData: null,\n isCalcReady: false,\n dateDescription: [],\n iteration: iteration,\n removeArrayId: false,\n conditionOpen: false,\n previewSuccess: false,\n stmMainContainer: true,\n showWooCommerce: false,\n currency_settings: null,\n container: \"v-container\",\n location_url: '',\n paymentMethod: '',\n\n textCopy: \"Copy shortcode\",\n\n demoImport: {\n // Custom demo import\n image: {\n file: null\n },\n files: null,\n file: null,\n custom: false,\n noFile: 'No file chosen',\n\n // Default demo import\n load:true,\n progress_load:false,\n progress:0,\n step_progress: null,\n step:[],\n info: {\n \"calculators\": 0,\n },\n info_progress: [],\n finish: false,\n progress_data: \"\"\n },\n\n background: {\n v_container: {\n type: 'solid'\n }\n },\n\n stripe: {\n stripe: '',\n stripeCard: '',\n stripeComplete: '',\n },\n\n payment: {\n status: '',\n message: '',\n },\n\n modal: {\n isOpen: false,\n hasMask: true,\n canClickMask: false,\n hasX: false\n },\n list: [],\n }\n },\n\n mounted() {\n let vm = this;\n vm.preloader = false;\n if(this.$refs.calc)\n vm.stmCalcData = window['stmCalc_' + this.$refs.calc.dataset.calcId];\n\n if ( typeof vm.stmCalcData.defaults !== \"undefined\") {\n window.stripe_id = '';\n if(typeof stripeData !== \"undefined\") window.stripe_id = stripeData.id;\n vm.location_url = vm.stmCalcData.siteurl;\n\n if(typeof vm.stmCalcData.defaults !== \"undefined\"){\n vm.projectId = vm.stmCalcData.id;\n vm.styleStore = Object.assign({}, vm.styleStore, vm.stmCalcData.defaults);\n }\n\n vm.response = vm.stmCalcData.autoCalc;\n vm.stmAutoCalc();\n\n if(typeof vm.stmCalcData.conditions !== \"undefined\"){\n vm.conditions = vm.stmCalcData.conditions[0];\n vm.startCondition();\n }\n } else if(typeof stmCalcAdmin !== \"undefined\"){\n vm.location_url = stmCalcAdmin.siteurl;\n vm.initListings();\n vm.editItem();\n }\n\n vm.customizeListing();\n if (typeof DatePicker !== \"undefined\")\n vm.setCalendarCss();\n },\n\n computed: {\n dragOptions() {\n return {\n animation: 200,\n group: \"description\",\n disabled: false,\n ghostClass: \"ghost\"\n };\n },\n\n isLastStep: function () {\n let vm = this;\n return (vm.step === vm.max)\n },\n },\n\n watch: {\n readyFields() {\n this.checkAvailable();\n },\n\n paymentMethod: function (value) {\n let vm = this;\n if (value === 'stripe') {\n vm.generateStripe();\n } else {\n vm.payment.status = '';\n vm.payment.message = '';\n }\n }\n },\n\n methods: {\n\n initListings: function(){\n let vm = this;\n vm.getListings().then(function (response) {\n if (response.body.success) {\n vm.listings = response.body.message.main;\n vm.contactForms = response.body.message.forms;\n vm.wcProducts = response.body.message.products;\n }\n });\n },\n\n storeStyles: function(name, obj, field, index){\n let vm = this;\n vm.custom_fields[name].fields[index] = field;\n\n if(typeof obj === \"object\")\n for(let o in obj)\n vm.$set(vm.styleStore[name], o, obj[o]);\n },\n\n changeStyles: function () {\n let vm = this;\n\n let id = vm.checkURI('id');\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/save-styles/', {\n id: id,\n styles: vm.styleStore,\n fields: vm.custom_fields,\n }).then(function (response) {\n vm.stmCloseModal('.ccb-changes-saved');\n document.location.reload(true)\n });\n },\n\n customizeListing: function() {\n let vm = this;\n let id = vm.checkURI('id');\n if (vm.checkURI('action') === 'customize' && id) {\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/edit-listing/', {id: id}).then(function (response) {\n let data = response.body.message.field;\n if (response.body.success) {\n vm.readyFields = data.field;\n vm.projectName = data.project_name;\n vm.custom_fields = data.custom_fields;\n vm.formula = response.body.message.formula[0];\n vm.styleStore = Object.assign({}, vm.styleStore, data.defaults);\n\n vm.settings = data.settings[0];\n if(vm.settings && vm.settings.currency)\n vm.currency_settings = vm.settings.currency;\n setTimeout(function () {\n vm.hasAccess = true;\n }, 1000)\n }\n });\n } else if (vm.checkURI('action') === 'listing') {\n vm.create = true;\n document.querySelector('#ccb-create-calc').removeAttribute('checked');\n document.querySelector('#ccb-calc-list').setAttribute('checked', 'checked');\n }\n },\n\n currencyFormat: function(val){\n let vm = this;\n if(vm.currency_settings){\n let test = this.get_currency_format(val, vm.currency_settings.num_after_integer, vm.currency_settings.decimal_separator, vm.currency_settings.thousands_separator);\n }\n\n return val;\n },\n\n currencyFormatPreview: function(val, element){\n let vm = this;\n\n if(element && element.hasOwnProperty('allowRound') && element.allowRound)\n return Math.round(val);\n\n if(vm.currency_settings){\n\n val = this.get_currency_format(\n val,\n vm.currency_settings.num_after_integer,\n vm.currency_settings.decimal_separator,\n vm.currency_settings.thousands_separator\n );\n\n vm.currency_settings.currency = vm.currency_settings.currency\n ? vm.currency_settings.currency\n : '';\n\n if(vm.currency_settings.currencyPosition === 'left'){\n val = vm.currency_settings.currency + val;\n }\n\n if(vm.currency_settings.currencyPosition === 'right'){\n val = val + vm.currency_settings.currency;\n }\n\n if(vm.currency_settings.currencyPosition === 'left_with_space'){\n val = val + ' ' + vm.currency_settings.currency;\n }\n\n if(vm.currency_settings.currencyPosition === 'right_with_space'){\n val = vm.currency_settings.currency + ' ' + val;\n }\n }\n\n return val;\n },\n\n checkAvailable() {\n let vm = this;\n if(typeof vm.readyFields !== \"undefined\")\n vm.readyFields.forEach((value, index) => {\n if (typeof value === \"undefined\" || !value.hasOwnProperty('_id')) {\n vm.readyFields.splice(index, 1);\n }\n });\n },\n\n log: function (event) {\n\n let vm = this;\n let current = event.added;\n\n if (current) {\n vm.newIndex = current.newIndex;\n vm.getField(current.element.type);\n }\n },\n\n generateStripe: function (access = true) {\n let vm = this;\n Vue.nextTick(function () {\n\n if (!stripe_id.length && access) {\n vm.payment.status = 'danger';\n vm.payment.message = 'Something went wrong';\n return false;\n } else if(access) {\n vm.payment.status = '';\n vm.payment.message = '';\n }\n\n vm.stripe.stripe = Stripe(stripe_id);\n let elements = vm.stripe.stripe.elements();\n vm.stripe.stripeCard = elements.create('card');\n vm.stripe.stripeCard.mount('#stm-lms-stripe_' + vm.projectId);\n vm.stripe.stripeCard.addEventListener('change', function (event) {\n vm.stripe.stripeComplete = event.complete;\n });\n });\n },\n\n toggleModal: function (event) {\n let vm = this;\n if(typeof event !== \"undefined\" && !event.screenX){\n return;\n }\n\n vm.calcTotal = [];\n vm.toolZIndex = !vm.toolZIndex;\n vm.modal.isOpen = !vm.modal.isOpen;\n\n if (this.modal.isOpen) {\n vm.temp = vm.checkTotalFields();\n vm.previewSuccess = true;\n\n vm.response = {\n 'stm-formula': vm.temp,\n 'stm-fields': vm.readyFields,\n };\n vm.stmAutoCalc();\n\n setTimeout(function () {\n vm.$sections = vm.$el.querySelectorAll('.ccb-modal-section');\n vm.max = vm.$sections.length;\n }, 1000);\n }\n },\n\n finish: function () {\n let vm = this;\n vm.toggleModal()\n },\n\n getListings: function () {\n let vm = this;\n return vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/stm-listing/');\n },\n\n checkURI: function (parameterName) {\n let result = '',\n temp = [];\n let uri = location.search.substr(1).split(\"&\");\n for (let index = 0; index < uri.length; index++) {\n temp = uri[index].split(\"=\");\n if (temp[0] === parameterName) result = decodeURIComponent(temp[1]);\n }\n return result;\n },\n\n sendForm: function (data) {\n let vm = this;\n let totalDesc = [];\n vm.redirectData = data.redirect;\n\n let dateCount = 0;\n if(data && typeof data.descriptions !== \"undefined\")\n data.descriptions.forEach(function (element) {\n const eValue = vm.calcTotal[element.key] ? vm.calcTotal[element.key].value : 0;\n let value = element.allow_currency\n ? vm.currencyFormat(eValue)\n : eValue;\n\n if(element.alias && element.alias.indexOf('datePicker') !== -1) {\n let dataVal = vm.dateDescription[dateCount] ? vm.dateDescription[dateCount].value : 0;\n dateCount++;\n value += dataVal +'\\n';\n }\n\n let options = '';\n if(vm.calcTotal[element.key].options && vm.calcTotal[element.key].options.length > 0 ){\n options += ' (' + vm.calcTotal[element.key].options.map(e => e.label).join(', ') + ') ';\n }\n\n totalDesc.push({\n value,\n options,\n label: element.label,\n allow_currency: element.allow_currency,\n alias: vm.calcTotal[element.key] ? vm.calcTotal[element.key].label : '',\n\n });\n });\n\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/send-form/', {\n mainInfo: {\n fields: totalDesc,\n subject: data.subject,\n currency: data.currency,\n userEmail: data.userEmail,\n clientEmail: data.clientEmail,\n },\n redirect: vm.redirectData,\n calcTotals: vm.formula,\n sendFields: data.fields,\n ccb_recaptcha: data.ccb_recaptcha,\n currency: vm.currency_settings,\n }).then(function (response) {\n let body = response.body;\n if(body.success && body.redirect){\n if(body.redirect.type === \"woocommerce\") {\n vm.wooCommerceCallback( vm.redirectData.params, vm.redirectData.item_name, vm.redirectData.descriptions, vm.redirectData.payment, 2000);\n }else if(body.redirect.type === 'paypal') {\n vm.paymentMethod = 'paypal';\n vm.paymentMethodCallback( vm.redirectData.params, vm.redirectData.item_name, vm.redirectData.payment, 1000);\n } else if(body.redirect.type === 'stripe') {\n vm.showStripe = true;\n }\n }\n })\n },\n\n sendFromStripe(stripe) {\n let vm = this;\n\n if(!stripe) return;\n\n vm.stripe = stripe;\n vm.stripe.stripe.createToken(vm.stripe.stripeCard).then(function (result) {\n vm.redirectData.stripe = result;\n vm.stripeResult( vm.redirectData.params, vm.redirectData.item_name, vm.redirectData.stripe, vm.redirectData.payment);\n });\n },\n\n wooCommerceCallback: function (params, item_name, descriptions, payment, timeout = 0) {\n let vm = this;\n let desc = [];\n\n if(typeof descriptions !== \"undefined\")\n descriptions.forEach(function (element) {\n desc.push({\n alias: element.label,\n value: vm.calcTotal[element.key] ? vm.calcTotal[element.key].value : 0\n });\n });\n\n if(vm.formula.length === 0){\n return;\n }\n\n $.ajax({\n type: 'POST',\n url: '/wp-admin/admin-ajax.php',\n beforeSend: function() {\n if(timeout === 0) vm.isCalcReady = false;\n },\n data: {\n action: 'stm_woo_callback',\n descriptions: desc,\n item_name: item_name,\n payment: payment,\n calcTotals: vm.formula,\n woo_info: params[0].wooCommerce,\n },\n success: function (data) {\n if (data.status) {\n data.page = data.page ? data.page : '';\n\n vm.isActive = false;\n\n vm.showForm = false;\n vm.showWooCommerce = true;\n setTimeout(function () {\n\n window.location.href = data.page;\n }, timeout);\n }\n },\n error: function() {\n alert('Something went wrong, please try again!');\n vm.isCalcReady = true;\n },\n });\n },\n\n paymentMethodCallback: function (data, item_name, payment, timeout = 0) {\n\n let vm = this;\n if (vm.paymentMethod.length > 0) {\n vm.payment.status = '';\n if (vm.paymentMethod === 'paypal') {\n data = data[0] || {};\n vm.payment.status = 'success';\n vm.payment.message = 'Redirecting to PayPal';\n\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/ccb-paypal/', {\n payment: payment,\n item_name: item_name,\n calcTotals: vm.formula,\n paypal_info: data.paypal,\n thousands_separator: data.currency.thousands_separator,\n }).then(function (response) {\n if (response.body.success) {\n vm.showForm = false;\n vm.showPayPal = true;\n setTimeout(function () {\n window.location.replace(response.body.url);\n }, timeout)\n }\n });\n } else if (vm.paymentMethod === 'stripe') {\n vm.stripe.stripe.createToken(vm.stripe.stripeCard).then(function (result) {\n vm.stripeResult(data, item_name, result);\n })\n }\n } else {\n vm.payment.status = 'danger';\n vm.payment.message = 'No payment method selected';\n }\n },\n\n stripeResult(data, item_name, result, payment) {\n let vm = this;\n if (result.error) {\n vm.payment.message = result.error.message;\n vm.payment.status = result.error;\n } else {\n data = data[0];\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/ccb-stripe/', {\n payment: payment,\n item_name: item_name,\n calcTotals: vm.formula,\n stripe_info: data.stripe,\n token_id: result.token.id,\n }).then(function (data) {\n vm.payment.status = data.body.status;\n vm.payment.message = data.body.message;\n setTimeout(function () {\n if (data.body.reload) document.location.reload(true);\n }, 1500);\n });\n }\n },\n\n saveCalc: function (event, isSave) {\n let vm = this;\n let temp = vm.checkTotalFields();\n let id = vm.projectId ? vm.projectId : null;\n\n if(vm.settings.length === 0 || !vm.settings[0].hasOwnProperty('general')){\n\n vm.settings[0] = {\n general: {\n header_title: 'Total Summary',\n descriptions: 'show',\n boxStyle: 'vertical',\n },\n currency: {\n currency: '$',\n num_after_integer: 2,\n decimal_separator: '.',\n thousands_separator: ',',\n currencyPosition: 'left_with_space',\n }\n };\n }\n\n vm.extraInfo = [];\n vm.extraInfo.push(id);\n vm.extraInfo.push(vm.projectName);\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/save-settings/', {\n formula: temp,\n settings: vm.settings,\n extraInfo: vm.extraInfo,\n conditions: vm.conditions,\n readyFields: vm.readyFields,\n }).then(function (response) {\n if(response.body.success){\n let calc_id = response.body.calc_id;\n let className = '.ccb-create-calc';\n if(isSave)\n className = '.ccb-save-msg';\n\n vm.stmCloseModal(className, 1500);\n setTimeout(function () {\n window.location.replace(vm. location_url + '/wp-admin/admin.php?page=cost_calculator_builder&action=edit&id=' + calc_id);\n }, 1000)\n }\n });\n },\n\n copyText(id) {\n const copyText = document.querySelector(`.calc-short-code[data-id='${id}']`);\n copyText.setAttribute('type', 'text')\n\n copyText.select();\n copyText.setSelectionRange(0, 99999);\n document.execCommand(\"copy\");\n copyText.setAttribute('type', 'hidden')\n this.textCopy = 'Copied';\n },\n\n checkTotalFields: function () {\n let _formula = '',\n vm = this,\n temp = [];\n vm.formula = [];\n if(typeof vm.readyFields !== \"undefined\")\n vm.readyFields.forEach(function (element) {\n if (element.type === 'Total') {\n vm.formula.push({\n id: element.id,\n label: element.label,\n formula: element.costCalcFormula,\n symbol: element.symbol\n });\n }\n });\n\n if (!vm.formula.length && typeof vm.readyFields !== \"undefined\") {\n vm.readyFields.forEach(function (element) {\n if (element.alias) {\n _formula += element.alias + ' + ';\n }\n });\n\n let last = _formula.lastIndexOf(\" \") - 1;\n _formula = _formula.substring(0, last);\n temp = [{label: 'Total', formula: _formula, symbol: ''}];\n\n } else {\n temp = vm.formula;\n }\n return temp;\n },\n\n removeFields: function (id, order_id) {\n let vm = this;\n vm.formula.splice(id, 1);\n vm.readyFields.splice(id, 1);\n if (order_id) {\n vm.calcTotal.splice(order_id - 1, 1);\n }\n },\n\n closeModal: function () {\n let vm = this;\n vm.fieldId = null;\n vm.modalData = null;\n vm.modalField = false;\n vm.stmDisplay = false;\n },\n\n getField: function (type) {\n let vm = this;\n vm.modalField = type;\n vm.stmDisplay = true;\n },\n\n checkSettings: function (type, id) {\n let vm = this;\n vm.fieldId = id;\n vm.modalField = type;\n vm.stmDisplay = true;\n },\n\n showContainer: function () {\n let vm = this;\n if (vm.projectName.length) {\n vm.access = true;\n vm.hasAccess = true;\n vm.showTools = true;\n vm.navZIndex = false;\n vm.stmMainContainer = false;\n }\n },\n\n setSettings: function (field, id) {\n let vm = this;\n vm.closeModal();\n vm.settingsId = id;\n vm.settings[id] = field;\n\n vm.currency_settings = vm.settings[0].currency;\n },\n\n removePrevent: function(e) {\n e.preventDefault();\n },\n\n applyContactForm: function(cfForm, redirect) {\n let vm = this, input;\n if(typeof wpcf7 !== \"undefined\") {\n $( 'div.wpcf7 > form' ).each( function() {\n let $form = $( this );\n wpcf7.initForm( $form );\n if ( wpcf7.cached ) {\n wpcf7.refill( $form );\n }\n });\n if($('.ajax-loader').length > 1) $('.ajax-loader').last().remove();\n\n if(typeof redirect !== \"undefined\") {\n document.addEventListener( 'wpcf7mailsent', function( event ) {\n\n if(event.detail.inputs) {\n input = event.detail.inputs.filter(element => element.name && element.name === 'ccb-action');\n\n if(vm.redirectData.type === \"woocommerce\") {\n vm.wooCommerceCallback(vm.redirectData.params, vm.redirectData.item_name, vm.redirectData.descriptions, vm.redirectData.payment);\n } else if(vm.redirectData.type === 'paypal') {\n vm.paymentMethod = 'paypal';\n vm.paymentMethodCallback(vm.redirectData.params, vm.redirectData.item_name, vm.redirectData.payment);\n } else if(vm.redirectData.type === 'stripe') {\n\n\n if(document.querySelector('#stm-lms-stripe_' + vm.projectId)){\n vm.clearDom('block', 'none');\n }else {\n\n let stripe = document.createElement('div');\n stripe.id = 'stm-lms-stripe_' + vm.projectId;\n\n let stripeBtnWrap = document.createElement('div');\n let stripeBtn = document.createElement('button');\n\n stripeBtn.type = 'button';\n stripeBtn.className = 'btn btn-success';\n stripeBtn.innerText = 'Purchase';\n\n stripeBtnWrap.className = 'ccb-stripeBtn-wrap';\n stripeBtnWrap.appendChild(stripeBtn);\n\n setTimeout(function () {\n let cf7Message = document.querySelector('.wpcf7-mail-sent-ok');\n\n\n if(cf7Message && cf7Message.innerText !== \"\") {\n\n let thanksMsg = document.createElement('div');\n\n thanksMsg.innerHTML = cf7Message.innerHTML;\n thanksMsg.className = cf7Message.className;\n thanksMsg.id = 'ccb-thanks-message';\n\n thanksMsg.style.display = \"block\";\n cfForm.parentNode.parentNode.insertBefore(thanksMsg, cfForm.parentNode);\n }\n\n cfForm.parentNode.parentNode.insertBefore(stripe, cfForm.parentNode);\n cfForm.parentNode.parentNode.insertBefore(stripeBtnWrap, cfForm.parentNode);\n cfForm.style.display = 'none';\n vm.generateStripe(false);\n\n stripeBtn.addEventListener('click', function () {\n vm.stripe.stripe.createToken(vm.stripe.stripeCard).then(function (result) {\n vm.redirectData.stripe = result;\n vm.stripeResult(vm.redirectData.params, vm.redirectData.item_name, vm.redirectData.stripe, vm.redirectData.payment);\n });\n })\n\n }, 500)\n\n }\n }\n }\n }, false );\n }\n }\n },\n\n nextButtonCallback: function (forms, descriptions, currency) {\n let i = 0;\n let vm = this;\n let subtotal = '';\n let totalFound = '';\n let text = forms[0].formFields.body;\n vm.nextButton = false;\n let dateCount = 0;\n if(typeof descriptions !== \"undefined\")\n descriptions.forEach(function (element) {\n let value = vm.calcTotal[element.key] ? vm.calcTotal[element.key].value : 0;\n let alias = vm.calcTotal[element.key] ? vm.calcTotal[element.key].label : '';\n subtotal += element.label +': ';\n\n if(alias) subtotal += ' ('+ alias +') ';\n if(vm.calcTotal[element.key] && vm.calcTotal[element.key].options && vm.calcTotal[element.key].options.length > 0)\n subtotal += ' (' + vm.calcTotal[element.key].options.map(e => e.label).join(', ') + ') ';\n\n if(element.allow_currency)\n subtotal += vm.getCurrencyPos(value, currency);\n else\n if(element.alias && element.alias.indexOf('datePicker') !== -1) {\n let dataVal = vm.dateDescription[dateCount] ? vm.dateDescription[dateCount].value : 0;\n dateCount++;\n subtotal += dataVal +'\\n';\n } else\n subtotal += value +'\\n';\n });\n\n\n if (vm.formula && vm.formula.length > 0) {\n vm.formula.forEach(function (element, index) {\n if (text.indexOf('[ccb-total-' + index + ']') !== -1) {\n let regex = '[ccb-total-' + index + ']';\n text = text.replaceAll(regex, vm.getCurrencyPos(element.total, currency))\n }\n });\n }\n\n if (text.indexOf('[ccb-subtotal]') !== -1) {\n let regex = '[ccb-subtotal]';\n text = text.replaceAll(regex, subtotal);\n }\n\n let j = 0;\n let replacement = '[ccb-total-';\n while (text.indexOf(replacement) !== -1 && forms[0].formFields.allowContactForm) {\n\n totalFound = replacement + i + ']';\n let position = text.indexOf(totalFound);\n\n if (position !== -1)\n text = text.replace(text.substr(position, totalFound.length), 0);\n else\n i++;\n\n j++;\n if(j === 100) break;\n }\n\n\n const wrapper = document.querySelector(`*[data-calc-id=\"${vm.projectId}\"]`);\n if (wrapper.querySelector('.ccb-contact-form7')) {\n let $form = wrapper.querySelector('.ccb-contact-form7 form');\n $('.ccb-contact-form7 form ccb-action').remove();\n\n if($form.querySelector('.wpcf7-submit')) $form.querySelector('.wpcf7-submit').parentElement.style.display = 'block';\n let textarea = wrapper.querySelector('.ccb-contact-form7').querySelector('textarea');\n\n const texts = wrapper.querySelectorAll('.ccb-inner-wrapper.text-area textarea');\n const textAreasText = Array.from(texts).map(el => el && el.value + '\\n').join('');\n\n if(textAreasText) text = textAreasText + '\\n' + text;\n if(textarea) textarea.value = vm.parser(text);\n let redirect;\n\n\n if(forms[0].formFields.payment && forms[0].formFields.paymentMethod){\n redirect = true;\n vm.redirectData = {\n params: forms,\n item_name: forms[0].general.title,\n payment: forms[0].formFields.payment,\n type: forms[0].formFields.paymentMethod,\n descriptions: descriptions,\n };\n\n if($form.querySelector('.ccb-action')) $form.querySelector('.ccb-action').remove();\n let ccbInp = document.createElement('input');\n ccbInp.type = 'hidden';\n ccbInp.name = 'ccb-action';\n ccbInp.value = '1';\n $form.appendChild(ccbInp);\n }\n\n vm.applyContactForm($form, redirect);\n }\n },\n\n getCurrencyPos(value, currency) {\n let subtotal = '', vm = this;\n if(vm.currency_settings.currency_position === 'left')\n subtotal = currency + vm.currencyFormat(value) +'\\n';\n\n else if(vm.currency_settings.currency_position === 'right')\n subtotal = vm.currencyFormat(value) + currency +'\\n';\n\n else if(vm.currency_settings.currency_position === 'right_with_space')\n subtotal = vm.currencyFormat(value) + ' ' + currency +'\\n';\n\n else {\n subtotal = currency + ' ' + vm.currencyFormat(value) +'\\n';\n }\n\n return subtotal;\n },\n\n editField: function (key) {\n let vm = this;\n let gotFieldByKey = vm.readyFields[key];\n let type = vm.readyFields[key].type.toLowerCase().replace(' ', '-');\n vm.fieldId = key;\n vm.modalField = type;\n vm.modalData = gotFieldByKey;\n\n vm.stmDisplay = true;\n },\n\n editItem: function () {\n let vm = this;\n let id = vm.checkURI('id');\n if (vm.checkURI('action') === 'edit' && id) {\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/edit-listing/', {id: id}).then(function (response) {\n let data = response.body.message.field;\n if (response.body.success) {\n vm.access = true;\n vm.create = false;\n vm.showTools = true;\n vm.hasAccess = true;\n vm.navZIndex = false;\n vm.projectId = data.id;;\n vm.stmMainContainer = false;\n vm.readyFields = data.field;\n vm.projectName = data.project_name;\n vm.formula = response.body.message.formula;\n vm.custom_fields = data.custom_fields;\n vm.styleStore = Object.assign({}, vm.styleStore, data.defaults);\n\n let condition = response.body.message.conditions;\n vm.conditions = Array.isArray(condition) && condition.length ? condition[0] : [];\n data.settings = Array.isArray(data.settings) ? data.settings : [data.settings];\n\n if (data.settings.length) {\n vm.settingsId = 0;\n vm.settings = data.settings;\n if(vm.settings[0] && vm.settings[0].currency)\n vm.currency_settings = vm.settings[0].currency;\n }\n\n setTimeout(() => {\n vm.isCalcReady = true;\n }, 1000)\n }\n });\n } else if (vm.checkURI('action') === 'listing') {\n vm.create = true;\n setTimeout(() => {\n vm.isCalcReady = true;\n }, 1000);\n document.querySelector('#ccb-create-calc').removeAttribute('checked');\n document.querySelector('#ccb-calc-list').setAttribute('checked', 'checked');\n }else {\n setTimeout(() => {\n vm.isCalcReady = true;\n }, 1000);\n }\n },\n\n saveCondition: function(data, isFree){\n let vm = this;\n if(!isFree)\n vm.conditions = data;\n },\n\n saveField: function (data, id = null, index = null) {\n let vm = this;\n if (id === null) {\n if (index || index === 0) {\n let len = vm.readyFields.length + 1;\n let current = vm.readyFields[index];\n for (let i = index; i < len; i++) {\n let next = vm.readyFields[i + 1];\n vm.readyFields[i + 1] = current;\n current = next;\n }\n vm.readyFields[index] = data;\n vm.checkAvailable();\n } else {\n vm.readyFields.push(data);\n }\n } else {\n vm.readyFields[id] = data;\n }\n vm.newIndex = null;\n vm.closeModal();\n },\n\n stmCalendarField: function (index, total, id, alias, value = null) {\n\n let vm = this;\n let time = null;\n\n if (value.length) {\n time = value[1] - value[0];\n vm.dateDescription[index] = {\n alias: alias,\n value: value[0].toLocaleDateString() + ' - ' + value[1].toLocaleDateString()\n };\n } else {\n let date = new Date(value);\n time = (date - Date.now());\n vm.dateDescription[index] = {alias: alias, value: date.toLocaleDateString()};\n }\n\n time = time > 0 ? Math.round(time / 1000 / 3600 / 24) : 0;\n time = typeof time === 'number' ? time : 0;\n\n vm.stmToCalculate(time, total, id, alias);\n },\n\n stmCancel: function () {\n let vm = this;\n window.location.replace(vm.location_url + '/wp-admin/admin.php?page=cost_calculator_builder&action=listing');\n },\n\n cloneVal(val) {\n return JSON.parse(JSON.stringify(val));\n },\n\n\n parser: function(encodedStr) {\n const parser = new DOMParser;\n const dom = parser.parseFromString(\n '
' + encodedStr,\n 'text/html');\n\n return dom.body.textContent;\n },\n\n stmAutoCalc: function () {\n let vm = this;\n let formula = vm.response['stm-formula'];\n if(vm.response['currency_settings'])\n vm.currency_settings = vm.stmCalcData.currency;\n if (vm.response['stm-fields'] && vm.response['stm-fields'].length) {\n\n vm.response['stm-fields'].forEach(function (elem, index) {\n let value;\n let unit = elem.hasOwnProperty('unit') ? elem.unit : 1;\n\n if (elem.alias && elem.hasOwnProperty('default') && elem.type !== 'Date Picker') {\n\n let defaultVal = elem.default;\n if(elem.default.indexOf('_') !== -1){\n defaultVal = vm.cloneVal(elem.default.split('_')[0]);\n let option = elem.options.find(_item => _item.optionValue === defaultVal);\n value = {value: defaultVal, label: option.optionText};\n }\n\n value = value || defaultVal;\n\n vm.stmToCalculate(value, formula, index, elem.alias, unit);\n }else if(elem && elem.alias && elem._tag === 'cost-checkbox') {\n vm.stmToCalculate([], formula, index, elem.alias, 1, elem.allowCurrency);\n }\n });\n\n let noFields = vm.response['stm-fields'].find(element => element.hasOwnProperty('default') || (element._tag === 'cost-checkbox'|| element.type !== 'Total' || element.type === 'Date Picker'));\n if(noFields === undefined && typeof vm.response['stm-fields'] !== \"undefined\") {\n vm.response['stm-fields'].forEach(element => {\n vm.formula = [];\n if(element.costCalcFormula.indexOf('_field_id_') === -1){\n let summary = eval(element.costCalcFormula);\n summary = summary !== summary || !isFinite(summary) ? 0 : summary;\n let val = summary;\n if(vm.currency_settings)\n val = vm.get_currency_format(summary, vm.currency_settings.num_after_integer, vm.currency_settings.decimal_separator, vm.currency_settings.thousands_separator);\n\n vm.formula.push({\n total: val,\n id: element.id,\n label: element.label\n\n });\n }\n });\n }\n }\n\n setTimeout(function () {\n vm.isCalcReady = true;\n }, 2000);\n },\n\n\n startCondition: function() {\n let vm = this;\n let timeId = setInterval(() => {\n if(vm.isCalcReady || vm.modal.isOpen) {\n if(vm.conditions && typeof vm.conditions.links !== \"undefined\")\n vm.conditions.links.forEach((element, eIndex) => {\n // get current calc\n const $form = $('*[data-calc-id=\"'+ vm.projectId +'\"]');\n // options\n const optionsTo = element.options_to;\n const optionsFrom = element.options_from;\n\n // option left wrap for action\n let elementRightWrap = $form.find('.wrap_' + optionsTo.alias);\n // if is not calculable\n if( (!optionsTo.hasOwnProperty('alias') && elementRightWrap.length === 0)) {\n elementRightWrap = $form.find('.id_for_label_' + optionsTo._id);\n }\n\n if(element && typeof element.condition !== \"undefined\" && typeof optionsFrom !== \"undefined\") {\n element.condition.forEach((condition, index) => {\n let found = vm.calcTotal.find(e => e && e.alias === optionsFrom.alias);\n const key = 'element_' + eIndex + index;\n vm.valuesStore[key] = typeof vm.valuesStore[key] !== \"undefined\" ? vm.valuesStore[key] : {};\n if(typeof found !== \"undefined\" && vm.valuesStore[key][found.alias] !== found.value ){\n vm.valuesStore[key][found.alias] = JSON.parse(JSON.stringify(found.value));\n let result = eval( found.value + condition.condition + condition.value + '');\n if(result ) {\n vm.renderCondition(elementRightWrap, condition.action, optionsTo, found.value)\n }else {\n vm.renderConditionToggle(elementRightWrap, condition.action, optionsTo, found.value)\n }\n\n }\n });\n }\n });\n\n clearInterval(timeId);\n }\n }, 1000)\n\n },\n\n renderCondition(elementRightWrap, action, optionsTo, value) {\n let vm = this;\n switch (action) {\n case 'Hide (leave in Total)': {\n elementRightWrap.slideUp();\n break\n }\n case 'Show': {\n let val = 0;\n vm.calcTotal = vm.calcTotal.map((calc, index) => {\n if(calc.alias === optionsTo.alias) {\n if(typeof vm.tempVal[optionsTo.alias] !== \"undefined\") {\n calc.value = JSON.parse(JSON.stringify(vm.tempVal[optionsTo.alias]));\n val = JSON.parse(JSON.stringify(vm.tempVal[optionsTo.alias]));\n calc.hide = false;\n elementRightWrap.slideDown();\n delete vm.tempVal[optionsTo.alias];\n vm.stmToCalculate(val, vm.response['stm-formula'], index, optionsTo.alias, optionsTo.unit ? optionsTo.unit : 1, false, false);\n\n }\n }\n\n return calc;\n });\n break\n }\n\n case 'Set value': {\n vm.calcTotal = vm.calcTotal.map((calc, index) => {\n if(calc.alias === optionsTo.alias) {\n calc.value = value;\n vm.setValue(value, elementRightWrap, calc.alias, index);\n vm.stmToCalculate(calc.value, vm.response['stm-formula'], index, optionsTo.alias, optionsTo.unit ? optionsTo.unit : 1, false, false );\n }\n return calc;\n }); break\n }\n\n case 'Set value and disable': {\n vm.calcTotal = vm.calcTotal.map((calc, index) => {\n if(calc.alias === optionsTo.alias) {\n calc.value = value;\n vm.setValue(value, elementRightWrap, calc.alias, index);\n elementRightWrap.addClass('calc-field-disable');\n vm.stmToCalculate(calc.value, vm.response['stm-formula'], index, optionsTo.alias, optionsTo.unit ? optionsTo.unit : 1, false, false );\n }\n\n return calc;\n }); break\n }\n case 'Hide': {\n elementRightWrap.slideUp();\n vm.calcTotal = vm.calcTotal.map((calc, index) => {\n\n if(calc.alias === optionsTo.alias) {\n vm.tempVal[optionsTo.alias] = JSON.parse(JSON.stringify(calc.value));\n calc.value = 0;\n calc.hide = true;\n vm.stmToCalculate(0, vm.response['stm-formula'], index, optionsTo.alias, optionsTo.unit ? optionsTo.unit : 1, false, false );\n }\n\n return calc;\n });\n break\n }\n default: break;\n }\n },\n\n renderConditionToggle(elementRightWrap, action, optionsTo) {\n let vm = this;\n switch (action) {\n case 'Hide (leave in Total)': {\n elementRightWrap.slideDown();\n break\n }\n case 'Hide': {\n elementRightWrap.slideDown();\n let val = 0;\n vm.calcTotal = vm.calcTotal.map((calc, index) => {\n if(calc.alias === optionsTo.alias) {\n if(typeof vm.tempVal[optionsTo.alias] !== \"undefined\") {\n calc.value = JSON.parse(JSON.stringify(vm.tempVal[optionsTo.alias]));\n val = JSON.parse(JSON.stringify(vm.tempVal[optionsTo.alias]));\n calc.hide = false;\n delete vm.tempVal[optionsTo.alias];\n vm.stmToCalculate(val, vm.response['stm-formula'], index, optionsTo.alias, optionsTo.unit ? optionsTo.unit : 1, false, false);\n }\n }\n\n return calc;\n });\n break\n }\n\n case 'Set value and disable': {\n if(typeof vm.calcTotal !== \"undefined\")\n vm.calcTotal.forEach(calc => {\n if(calc.alias === optionsTo.alias) {\n elementRightWrap.removeClass('calc-field-disable');\n }\n });\n break\n }\n default: break;\n }\n },\n\n setValue(value, elementRight, alias, index) {\n if(alias.indexOf('range') !== -1){\n if(typeof this.$refs[alias] !== \"undefined\")\n this.$refs[alias].changeVal(value)\n this.calcTotal[index].value = value;\n }\n\n else if(alias.indexOf('dropDown') !== -1) {\n elementRight.find('select option').each((v, k) => {\n if(k.value === value + '_' + v) {\n elementRight.find('select').val(k.value);\n }\n });\n }\n\n else if(alias.indexOf('radio') !== -1) {\n elementRight.find(`input.radio_${alias}`).each((v, k) => {\n k.checked = k.value === value + '_' + v\n });\n }\n\n else if(alias.indexOf('checkbox') !== -1) {\n elementRight.find(`input.checkbox_${alias}`).each((v, k) => {\n k.checked = parseInt(k.value) === parseInt(value);\n });\n }\n\n else if(alias.indexOf('quantity') !== -1) {\n elementRight.find('input').val(value);\n }\n },\n\n applyImporter: function() {\n let vm = this;\n let demo = vm.demoImport;\n demo.file = document.querySelector('#ccb-file');\n demo.file.click();\n },\n\n loadImage: function () {\n let vm = this;\n let demo = vm.demoImport;\n\n if(demo.file.value)\n demo.noFile = demo.file.value.match(/[\\/\\\\]([\\w\\d\\s\\.\\-\\(\\)]+)$/)[1];\n else\n demo.noFile = 'No file chosen';\n\n let fileToUpload = vm.$refs['image-file'].files[0];\n\n if (fileToUpload) {\n demo.files = fileToUpload;\n }\n },\n\n importNewLayout: function(){\n let vm = this;\n let demo = vm.demoImport;\n if(demo.files){\n let formData = new FormData();\n formData.append('type', 'single');\n formData.append('file', demo.files);\n\n vm.$set(demo.image, 'message', '');\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/custom-demo-import/', formData).then(function (response) {\n if(response.body.success) {\n demo.files = null;\n demo.noFile = 'No file chosen';\n vm.$set(demo.image, 'file', '');\n\n demo.info = response.body.message;\n for(let index in demo.info)\n demo.info_progress[index] = 0;\n demo.custom = true;\n vm.importDemos();\n }\n });\n }\n },\n\n getImportData: function(){\n let vm = this;\n vm.demoImport.load = true;\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/demo-import/').then(function(response){\n vm.demoImport.load = false;\n vm.demoImport.info = response.body;\n for(let index in vm.demoImport.info)\n vm.demoImport.info_progress[index] = 0;\n });\n },\n\n importDemos: function(){\n let vm = this;\n\n vm.demoImport.progress_load = true;\n vm.demoImport.step = Object.keys(vm.demoImport.info);\n vm.demoImport.step_progress = vm.demoImport.step[0];\n\n vm.progressImport();\n },\n\n progressImport: function(){\n let vm = this;\n let demo = vm.demoImport;\n let params = { step:demo.step_progress, key:demo.info_progress[demo.step_progress] };\n if(demo.custom) params['is_custom_import'] = true;\n\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/demo-import-run/', params).then(function(response){\n\n demo.progress_data += response.body.data+\" \\n \";\n let textarea = document.querySelector('#progress_data_textarea');\n textarea.scrollTop = textarea.scrollHeight;\n if(demo.info[demo.step_progress] > demo.info_progress[demo.step_progress]) {\n demo.info_progress[demo.step_progress] = response.body.key;\n demo.progress = Math.ceil( (response.body.key / demo.info[demo.step_progress]) * 100 );\n }\n\n if(demo.info[demo.step_progress] === demo.info_progress[demo.step_progress]) {\n demo.step_progress = vm.nextKey(demo.info, demo.step_progress);\n demo.progress = 0;\n vm.initListings();\n }\n\n if(demo.step_progress != null && response.body.success){\n vm.progressImport();\n }\n\n if(demo.step_progress == null){\n demo.finish = true;\n demo.progress_load = false;\n }\n });\n },\n\n nextKey: function(db, key) {\n let keys = Object.keys(db), i = keys.indexOf(key); i++;\n if(typeof keys[i] != \"undefined\")\n return keys[i];\n return null;\n },\n\n clearDom: function(hide, show) {\n if(document.querySelector('#ccb-thanks-message')) document.querySelector('#ccb-thanks-message').style.display = hide;\n if(document.querySelector('#stm-lms-stripe_' + this.projectId)) document.querySelector('#stm-lms-stripe_' + this.projectId).style.display = hide;\n if(document.querySelector('.ccb-stripeBtn-wrap')) document.querySelector('.ccb-stripeBtn-wrap').style.display = hide;\n if(document.querySelector('.ccb-contact-form7 form')) document.querySelector('.ccb-contact-form7 form').style.display = show;\n },\n\n stmToCalculate(value, mainFormula, id, alias, unit = 1, allowRound = false, condition = true) {\n let vm = this;\n\n vm.nextButton = true;\n vm.showStripe = false;\n vm.errorMessage = false;\n\n let [,field_id] = alias.split('_id_');\n if(typeof wpcf7 !== \"undefined\") {\n vm.clearDom('none', 'block');\n }\n\n let _formula = JSON.parse(JSON.stringify(mainFormula));\n if (typeof value === 'string' || typeof value === 'number') {\n vm.calcTotal[id] = {value: value ? value * unit : 0, alias: alias, id: parseInt(field_id)};\n } else if (Array.isArray(value)) {\n let total = 0;\n const options = [];\n for (let j in value) {\n total += value[j].value || value[j] || 0;\n\n if(value[j] && value[j].value) {\n options.push({\n label: value[j].label,\n value: value[j].value,\n });\n }\n }\n\n vm.calcTotal[id] = {\n alias,\n options,\n value: total,\n id: parseFloat(field_id),\n };\n\n } else if(typeof value === 'object'){\n vm.calcTotal[id] = {\n alias,\n value: value.value,\n label: value.label,\n id: parseFloat(field_id)};\n }\n\n let temp = JSON.parse(JSON.stringify(vm.calcTotal));\n\n if(typeof _formula !== \"undefined\")\n _formula.forEach(function (item) {\n vm.calcTotal.forEach(element => {\n if(!element.hasOwnProperty('alias')) return;\n\n if(allowRound)\n element.value = Math.round(element.value);\n let count = 0;\n\n while (item.formula.indexOf(element.alias) !== -1) {\n item.formula.trim();\n let posStart = item.formula.indexOf(element.alias);\n let length = element.alias.length;\n let last = item.formula[posStart + length];\n last = last === ' ' ? NaN : last;\n if(isNaN(last)){\n item.formula = item.formula.replace(element.alias, element.value);\n }else {\n let alias = element.alias + last;\n let found = temp.find(elem => elem && elem.alias === alias);\n\n if(typeof found !== \"undefined\" && found.alias)\n item.formula = item.formula.replace(found.alias, found.value);\n }\n\n count++;\n if(count === 5) break;\n }\n });\n });\n\n let replacement = ['range_field_id_', 'radio_field_id_', 'quantity_field_id_', 'dropDown_field_id_', 'checkbox_field_id_', 'datePicker_field_id_'];\n if(typeof _formula !== \"undefined\")\n _formula.forEach(function (element) {\n let i = 0;\n while (element.formula.indexOf('_field_id_') !== -1) {\n let position = element.formula.indexOf(replacement[i]);\n if (position !== -1) {\n let temp = element.formula.substr(position, replacement[i].length + 2);\n let lastIndex = temp[temp.length - 1];\n\n if(parseInt(lastIndex) !== parseInt(lastIndex)) {\n temp = element.formula.substr(position, replacement[i].length + 1);\n }\n element.formula = element.formula.replace(temp, 0);\n\n } else {\n i++;\n }\n }\n });\n\n vm.formula = [];\n\n if(typeof _formula !== \"undefined\")\n _formula.forEach(function (element) {\n let summary = eval(element.formula);\n summary = summary !== summary || !isFinite(summary) ? 0 : summary;\n\n let val = summary;\n\n if(vm.currency_settings)\n val = vm.get_currency_format(summary, vm.currency_settings.num_after_integer, vm.currency_settings.decimal_separator, vm.currency_settings.thousands_separator);\n\n vm.formula.push({\n total: val,\n id: element.id,\n label: element.label\n });\n });\n\n if(typeof vm.stmCalcData.conditions !== \"undefined\" || vm.modal.isOpen)\n vm.startCondition();\n },\n\n toggleCondition() {\n this.conditionOpen = !this.conditionOpen;\n setTimeout(() => {\n if(this.conditionOpen)\n jQuery('.ccb-condition').slideDown();\n else\n jQuery('.ccb-condition').slideUp();\n }, 0);\n },\n\n get_currency_format:function(amount, decimalCount = 2, decimal = \".\", thousands = \",\") {\n try {\n decimalCount = Math.abs(decimalCount);\n decimalCount = isNaN(decimalCount) ? 2 : decimalCount;\n\n const negativeSign = amount < 0 ? \"-\" : \"\";\n amount = parseFloat(amount);\n let i = parseInt(amount = Math.abs(Number(amount) || 0).toFixed(decimalCount)).toString();\n let j = (i.length > 3) ? i.length % 3 : 0;\n\n return negativeSign + (j ? i.substr(0, j) + thousands : '') + i.substr(j).replace(/(\\d{3})(?=\\d)/g, \"$1\" + thousands) + (decimalCount ? decimal + Math.abs(amount - i).toFixed(decimalCount).slice(2) : \"\");\n } catch (e) {\n w.log(e)\n }\n },\n\n duplicateListing: function(id){\n let vm = this;\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/duplicate-listing/', {\n id: id,\n }).then(function (response) {\n if (response.body.success) {\n vm.listings = response.body.calculators;\n vm.stmCloseModal('.ccb-duplicate-calc');\n }\n });\n\n },\n\n removeFromListing: function (id, index) {\n let vm = this;\n vm.removeId = id;\n vm.removeArrayId = index;\n },\n\n removeItem: function () {\n let vm = this;\n vm.$http.post(vm.location_url + '/wp-json/cost-calc/v1/remove-existing/', {\n id: vm.removeId,\n }).then(function (response) {\n if (response.body.success) {\n vm.listings.splice(vm.removeArrayId, 1);\n vm.stmCloseModal('.ccb-delete-calc');\n }\n });\n },\n\n stmCloseModal: function (selector, speed = 2500, needle = 'ccb-msg-active') {\n $(selector).addClass(needle);\n $({to: 0}).animate({to: 1}, speed, function () {\n $(selector).removeClass(needle);\n });\n },\n\n changePosition: function (event) {\n let selector = '.ccb-side-bar-tools',\n hide = 'ccb-tools-hide',\n posSelector = 'ccb-li-position-relative';\n\n let labelAttrFor = event.target.getAttribute('for');\n let liSelector = $('#' + labelAttrFor).attr('class');\n\n let stmArr = liSelector.split(' ');\n\n $('.' + posSelector).removeClass(posSelector);\n $('.' + hide).removeClass(hide);\n $('li.' + stmArr[1]).addClass(posSelector);\n\n if (labelAttrFor === 'ccb-create-calc') {\n $(selector).removeClass(hide);\n } else {\n $(selector).addClass(hide);\n }\n },\n\n generateId: function () {\n\n let vm = this;\n let id = 0;\n let hasAccess = true;\n\n const ids = [];\n vm.readyFields.forEach(e => ids.push(parseInt(e._id)))\n for(let i = 0; i < ids.length; i++) {\n if(!ids.includes(i) && hasAccess) {\n hasAccess = false;\n id = i;\n }\n }\n\n if(hasAccess) id = vm.readyFields.length;\n return id;\n },\n\n setCalendarCss: function () {\n\n if(!this.styleStore['date-picker']) return;\n\n let styleId = 'custom_styles';\n let $ = jQuery;\n if($('#' + styleId).length) $('#' + styleId).remove();\n\n let datePickerStyles = this.styleStore['date-picker'];\n let color = datePickerStyles['background-color'] ? datePickerStyles['background-color'] : '#ffffff';\n\n\n let innerStyle = '';\n $('head').append(innerStyle);\n }\n },\n\n updated() {\n let vm = this;\n if(typeof vm.location_url !== 'undefined'){\n vm.order = vm.generateId();\n }\n },\n });\n\n iteration++;\n });\n })\n})(jQuery);","export default [\n {id: 1, type: 'html', icon: 'fab fa-html5', _name: 'Html', description: 'html elements'},\n {id: 2, type: 'drop-down', icon: 'fas fa-chevron-down', _name: 'Drop Down', description: 'drop-down fields'},\n {id: 3, type: 'radio-button', icon: 'fa-dot-circle', _name: 'Radio button', description: 'html radio buttons'},\n {id: 4, type: 'checkbox', icon: 'fas fa-check-circle', _name: 'Checkbox', description: 'checkbox fields'},\n {id: 5, type: 'range-button', icon: 'far fa-exchange', _name: 'Range button', description: 'range buttons'},\n {id: 6, type: 'quantity', icon: 'fas fa-calculator', _name: 'Quantity', description: 'quantity filed'},\n {id: 7, type: 'text-area', icon: 'far fa-pencil', _name: 'Text', description: 'text field'},\n {id: 8, type: 'line', icon: 'fas fa-ellipsis-h', _name: 'Line', description: 'horizontal rule'},\n {id: 9, type: 'date-picker', icon: 'fa-calendar-week', _name: 'Date Picker', description: 'date-picker field'},\n {id: 10, type: 'total', icon: 'fa-money-bill-alt', _name: 'Total', description: 'total field'},\n]","import Vuex from '../libs/vuex'\nimport formFields from \"./data\";\n\nVue.use(Vuex);\n\nexport default new Vuex.Store({\n state: {\n formFields,\n hasAccess: false,\n },\n getters: {\n getFields: state => {\n return state.formFields;\n },\n\n getStyles: state => {\n return state.styleData;\n },\n },\n});","/**\n * vuex v3.1.1\n * (c) 2019 Evan You\n * @license MIT\n */\n(function (global, factory) {\n typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n typeof define === 'function' && define.amd ? define(factory) :\n (global = global || self, global.Vuex = factory());\n}(this, function () { 'use strict';\n\n function applyMixin (Vue) {\n var version = Number(Vue.version.split('.')[0]);\n\n if (version >= 2) {\n Vue.mixin({ beforeCreate: vuexInit });\n } else {\n // override init and inject vuex init procedure\n // for 1.x backwards compatibility.\n var _init = Vue.prototype._init;\n Vue.prototype._init = function (options) {\n if ( options === void 0 ) options = {};\n\n options.init = options.init\n ? [vuexInit].concat(options.init)\n : vuexInit;\n _init.call(this, options);\n };\n }\n\n /**\n * Vuex init hook, injected into each instances init hooks list.\n */\n\n function vuexInit () {\n var options = this.$options;\n // store injection\n if (options.store) {\n this.$store = typeof options.store === 'function'\n ? options.store()\n : options.store;\n } else if (options.parent && options.parent.$store) {\n this.$store = options.parent.$store;\n }\n }\n }\n\n var target = typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n var devtoolHook = target.__VUE_DEVTOOLS_GLOBAL_HOOK__;\n\n function devtoolPlugin (store) {\n if (!devtoolHook) { return }\n\n store._devtoolHook = devtoolHook;\n\n devtoolHook.emit('vuex:init', store);\n\n devtoolHook.on('vuex:travel-to-state', function (targetState) {\n store.replaceState(targetState);\n });\n\n store.subscribe(function (mutation, state) {\n devtoolHook.emit('vuex:mutation', mutation, state);\n });\n }\n\n /**\n * Get the first item that pass the test\n * by second argument function\n *\n * @param {Array} list\n * @param {Function} f\n * @return {*}\n */\n\n /**\n * forEach for object\n */\n function forEachValue (obj, fn) {\n Object.keys(obj).forEach(function (key) { return fn(obj[key], key); });\n }\n\n function isObject (obj) {\n return obj !== null && typeof obj === 'object'\n }\n\n function isPromise (val) {\n return val && typeof val.then === 'function'\n }\n\n function assert (condition, msg) {\n if (!condition) { throw new Error((\"[vuex] \" + msg)) }\n }\n\n function partial (fn, arg) {\n return function () {\n return fn(arg)\n }\n }\n\n // Base data struct for store's module, package with some attribute and method\n var Module = function Module (rawModule, runtime) {\n this.runtime = runtime;\n // Store some children item\n this._children = Object.create(null);\n // Store the origin module object which passed by programmer\n this._rawModule = rawModule;\n var rawState = rawModule.state;\n\n // Store the origin module's state\n this.state = (typeof rawState === 'function' ? rawState() : rawState) || {};\n };\n\n var prototypeAccessors = { namespaced: { configurable: true } };\n\n prototypeAccessors.namespaced.get = function () {\n return !!this._rawModule.namespaced\n };\n\n Module.prototype.addChild = function addChild (key, module) {\n this._children[key] = module;\n };\n\n Module.prototype.removeChild = function removeChild (key) {\n delete this._children[key];\n };\n\n Module.prototype.getChild = function getChild (key) {\n return this._children[key]\n };\n\n Module.prototype.update = function update (rawModule) {\n this._rawModule.namespaced = rawModule.namespaced;\n if (rawModule.actions) {\n this._rawModule.actions = rawModule.actions;\n }\n if (rawModule.mutations) {\n this._rawModule.mutations = rawModule.mutations;\n }\n if (rawModule.getters) {\n this._rawModule.getters = rawModule.getters;\n }\n };\n\n Module.prototype.forEachChild = function forEachChild (fn) {\n forEachValue(this._children, fn);\n };\n\n Module.prototype.forEachGetter = function forEachGetter (fn) {\n if (this._rawModule.getters) {\n forEachValue(this._rawModule.getters, fn);\n }\n };\n\n Module.prototype.forEachAction = function forEachAction (fn) {\n if (this._rawModule.actions) {\n forEachValue(this._rawModule.actions, fn);\n }\n };\n\n Module.prototype.forEachMutation = function forEachMutation (fn) {\n if (this._rawModule.mutations) {\n forEachValue(this._rawModule.mutations, fn);\n }\n };\n\n Object.defineProperties( Module.prototype, prototypeAccessors );\n\n var ModuleCollection = function ModuleCollection (rawRootModule) {\n // register root module (Vuex.Store options)\n this.register([], rawRootModule, false);\n };\n\n ModuleCollection.prototype.get = function get (path) {\n return path.reduce(function (module, key) {\n return module.getChild(key)\n }, this.root)\n };\n\n ModuleCollection.prototype.getNamespace = function getNamespace (path) {\n var module = this.root;\n return path.reduce(function (namespace, key) {\n module = module.getChild(key);\n return namespace + (module.namespaced ? key + '/' : '')\n }, '')\n };\n\n ModuleCollection.prototype.update = function update$1 (rawRootModule) {\n update([], this.root, rawRootModule);\n };\n\n ModuleCollection.prototype.register = function register (path, rawModule, runtime) {\n var this$1 = this;\n if ( runtime === void 0 ) runtime = true;\n\n {\n assertRawModule(path, rawModule);\n }\n\n var newModule = new Module(rawModule, runtime);\n if (path.length === 0) {\n this.root = newModule;\n } else {\n var parent = this.get(path.slice(0, -1));\n parent.addChild(path[path.length - 1], newModule);\n }\n\n // register nested modules\n if (rawModule.modules) {\n forEachValue(rawModule.modules, function (rawChildModule, key) {\n this$1.register(path.concat(key), rawChildModule, runtime);\n });\n }\n };\n\n ModuleCollection.prototype.unregister = function unregister (path) {\n var parent = this.get(path.slice(0, -1));\n var key = path[path.length - 1];\n if (!parent.getChild(key).runtime) { return }\n\n parent.removeChild(key);\n };\n\n function update (path, targetModule, newModule) {\n {\n assertRawModule(path, newModule);\n }\n\n // update target module\n targetModule.update(newModule);\n\n // update nested modules\n if (newModule.modules) {\n for (var key in newModule.modules) {\n if (!targetModule.getChild(key)) {\n {\n console.warn(\n \"[vuex] trying to add a new module '\" + key + \"' on hot reloading, \" +\n 'manual reload is needed'\n );\n }\n return\n }\n update(\n path.concat(key),\n targetModule.getChild(key),\n newModule.modules[key]\n );\n }\n }\n }\n\n var functionAssert = {\n assert: function (value) { return typeof value === 'function'; },\n expected: 'function'\n };\n\n var objectAssert = {\n assert: function (value) { return typeof value === 'function' ||\n (typeof value === 'object' && typeof value.handler === 'function'); },\n expected: 'function or object with \"handler\" function'\n };\n\n var assertTypes = {\n getters: functionAssert,\n mutations: functionAssert,\n actions: objectAssert\n };\n\n function assertRawModule (path, rawModule) {\n Object.keys(assertTypes).forEach(function (key) {\n if (!rawModule[key]) { return }\n\n var assertOptions = assertTypes[key];\n\n forEachValue(rawModule[key], function (value, type) {\n assert(\n assertOptions.assert(value),\n makeAssertionMessage(path, key, type, value, assertOptions.expected)\n );\n });\n });\n }\n\n function makeAssertionMessage (path, key, type, value, expected) {\n var buf = key + \" should be \" + expected + \" but \\\"\" + key + \".\" + type + \"\\\"\";\n if (path.length > 0) {\n buf += \" in module \\\"\" + (path.join('.')) + \"\\\"\";\n }\n buf += \" is \" + (JSON.stringify(value)) + \".\";\n return buf\n }\n\n var Vue; // bind on install\n\n var Store = function Store (options) {\n var this$1 = this;\n if ( options === void 0 ) options = {};\n\n // Auto install if it is not done yet and `window` has `Vue`.\n // To allow users to avoid auto-installation in some cases,\n // this code should be placed here. See #731\n if (!Vue && typeof window !== 'undefined' && window.Vue) {\n install(window.Vue);\n }\n\n {\n assert(Vue, \"must call Vue.use(Vuex) before creating a store instance.\");\n assert(typeof Promise !== 'undefined', \"vuex requires a Promise polyfill in this browser.\");\n assert(this instanceof Store, \"store must be called with the new operator.\");\n }\n\n var plugins = options.plugins; if ( plugins === void 0 ) plugins = [];\n var strict = options.strict; if ( strict === void 0 ) strict = false;\n\n // store internal state\n this._committing = false;\n this._actions = Object.create(null);\n this._actionSubscribers = [];\n this._mutations = Object.create(null);\n this._wrappedGetters = Object.create(null);\n this._modules = new ModuleCollection(options);\n this._modulesNamespaceMap = Object.create(null);\n this._subscribers = [];\n this._watcherVM = new Vue();\n\n // bind commit and dispatch to self\n var store = this;\n var ref = this;\n var dispatch = ref.dispatch;\n var commit = ref.commit;\n this.dispatch = function boundDispatch (type, payload) {\n return dispatch.call(store, type, payload)\n };\n this.commit = function boundCommit (type, payload, options) {\n return commit.call(store, type, payload, options)\n };\n\n // strict mode\n this.strict = strict;\n\n var state = this._modules.root.state;\n\n // init root module.\n // this also recursively registers all sub-modules\n // and collects all module getters inside this._wrappedGetters\n installModule(this, state, [], this._modules.root);\n\n // initialize the store vm, which is responsible for the reactivity\n // (also registers _wrappedGetters as computed properties)\n resetStoreVM(this, state);\n\n // apply plugins\n plugins.forEach(function (plugin) { return plugin(this$1); });\n\n var useDevtools = options.devtools !== undefined ? options.devtools : Vue.config.devtools;\n if (useDevtools) {\n devtoolPlugin(this);\n }\n };\n\n var prototypeAccessors$1 = { state: { configurable: true } };\n\n prototypeAccessors$1.state.get = function () {\n return this._vm._data.$$state\n };\n\n prototypeAccessors$1.state.set = function (v) {\n {\n assert(false, \"use store.replaceState() to explicit replace store state.\");\n }\n };\n\n Store.prototype.commit = function commit (_type, _payload, _options) {\n var this$1 = this;\n\n // check object-style commit\n var ref = unifyObjectStyle(_type, _payload, _options);\n var type = ref.type;\n var payload = ref.payload;\n var options = ref.options;\n\n var mutation = { type: type, payload: payload };\n var entry = this._mutations[type];\n if (!entry) {\n {\n console.error((\"[vuex] unknown mutation type: \" + type));\n }\n return\n }\n this._withCommit(function () {\n entry.forEach(function commitIterator (handler) {\n handler(payload);\n });\n });\n this._subscribers.forEach(function (sub) { return sub(mutation, this$1.state); });\n\n if (\n options && options.silent\n ) {\n console.warn(\n \"[vuex] mutation type: \" + type + \". Silent option has been removed. \" +\n 'Use the filter functionality in the vue-devtools'\n );\n }\n };\n\n Store.prototype.dispatch = function dispatch (_type, _payload) {\n var this$1 = this;\n\n // check object-style dispatch\n var ref = unifyObjectStyle(_type, _payload);\n var type = ref.type;\n var payload = ref.payload;\n\n var action = { type: type, payload: payload };\n var entry = this._actions[type];\n if (!entry) {\n {\n console.error((\"[vuex] unknown action type: \" + type));\n }\n return\n }\n\n try {\n this._actionSubscribers\n .filter(function (sub) { return sub.before; })\n .forEach(function (sub) { return sub.before(action, this$1.state); });\n } catch (e) {\n {\n console.warn(\"[vuex] error in before action subscribers: \");\n console.error(e);\n }\n }\n\n var result = entry.length > 1\n ? Promise.all(entry.map(function (handler) { return handler(payload); }))\n : entry[0](payload);\n\n return result.then(function (res) {\n try {\n this$1._actionSubscribers\n .filter(function (sub) { return sub.after; })\n .forEach(function (sub) { return sub.after(action, this$1.state); });\n } catch (e) {\n {\n console.warn(\"[vuex] error in after action subscribers: \");\n console.error(e);\n }\n }\n return res\n })\n };\n\n Store.prototype.subscribe = function subscribe (fn) {\n return genericSubscribe(fn, this._subscribers)\n };\n\n Store.prototype.subscribeAction = function subscribeAction (fn) {\n var subs = typeof fn === 'function' ? { before: fn } : fn;\n return genericSubscribe(subs, this._actionSubscribers)\n };\n\n Store.prototype.watch = function watch (getter, cb, options) {\n var this$1 = this;\n\n {\n assert(typeof getter === 'function', \"store.watch only accepts a function.\");\n }\n return this._watcherVM.$watch(function () { return getter(this$1.state, this$1.getters); }, cb, options)\n };\n\n Store.prototype.replaceState = function replaceState (state) {\n var this$1 = this;\n\n this._withCommit(function () {\n this$1._vm._data.$$state = state;\n });\n };\n\n Store.prototype.registerModule = function registerModule (path, rawModule, options) {\n if ( options === void 0 ) options = {};\n\n if (typeof path === 'string') { path = [path]; }\n\n {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n assert(path.length > 0, 'cannot register the root module by using registerModule.');\n }\n\n this._modules.register(path, rawModule);\n installModule(this, this.state, path, this._modules.get(path), options.preserveState);\n // reset store to update getters...\n resetStoreVM(this, this.state);\n };\n\n Store.prototype.unregisterModule = function unregisterModule (path) {\n var this$1 = this;\n\n if (typeof path === 'string') { path = [path]; }\n\n {\n assert(Array.isArray(path), \"module path must be a string or an Array.\");\n }\n\n this._modules.unregister(path);\n this._withCommit(function () {\n var parentState = getNestedState(this$1.state, path.slice(0, -1));\n Vue.delete(parentState, path[path.length - 1]);\n });\n resetStore(this);\n };\n\n Store.prototype.hotUpdate = function hotUpdate (newOptions) {\n this._modules.update(newOptions);\n resetStore(this, true);\n };\n\n Store.prototype._withCommit = function _withCommit (fn) {\n var committing = this._committing;\n this._committing = true;\n fn();\n this._committing = committing;\n };\n\n Object.defineProperties( Store.prototype, prototypeAccessors$1 );\n\n function genericSubscribe (fn, subs) {\n if (subs.indexOf(fn) < 0) {\n subs.push(fn);\n }\n return function () {\n var i = subs.indexOf(fn);\n if (i > -1) {\n subs.splice(i, 1);\n }\n }\n }\n\n function resetStore (store, hot) {\n store._actions = Object.create(null);\n store._mutations = Object.create(null);\n store._wrappedGetters = Object.create(null);\n store._modulesNamespaceMap = Object.create(null);\n var state = store.state;\n // init all modules\n installModule(store, state, [], store._modules.root, true);\n // reset vm\n resetStoreVM(store, state, hot);\n }\n\n function resetStoreVM (store, state, hot) {\n var oldVm = store._vm;\n\n // bind store public getters\n store.getters = {};\n var wrappedGetters = store._wrappedGetters;\n var computed = {};\n forEachValue(wrappedGetters, function (fn, key) {\n // use computed to leverage its lazy-caching mechanism\n // direct inline function use will lead to closure preserving oldVm.\n // using partial to return function with only arguments preserved in closure enviroment.\n computed[key] = partial(fn, store);\n Object.defineProperty(store.getters, key, {\n get: function () { return store._vm[key]; },\n enumerable: true // for local getters\n });\n });\n\n // use a Vue instance to store the state tree\n // suppress warnings just in case the user has added\n // some funky global mixins\n var silent = Vue.config.silent;\n Vue.config.silent = true;\n store._vm = new Vue({\n data: {\n $$state: state\n },\n computed: computed\n });\n Vue.config.silent = silent;\n\n // enable strict mode for new vm\n if (store.strict) {\n enableStrictMode(store);\n }\n\n if (oldVm) {\n if (hot) {\n // dispatch changes in all subscribed watchers\n // to force getter re-evaluation for hot reloading.\n store._withCommit(function () {\n oldVm._data.$$state = null;\n });\n }\n Vue.nextTick(function () { return oldVm.$destroy(); });\n }\n }\n\n function installModule (store, rootState, path, module, hot) {\n var isRoot = !path.length;\n var namespace = store._modules.getNamespace(path);\n\n // register in namespace map\n if (module.namespaced) {\n store._modulesNamespaceMap[namespace] = module;\n }\n\n // set state\n if (!isRoot && !hot) {\n var parentState = getNestedState(rootState, path.slice(0, -1));\n var moduleName = path[path.length - 1];\n store._withCommit(function () {\n Vue.set(parentState, moduleName, module.state);\n });\n }\n\n var local = module.context = makeLocalContext(store, namespace, path);\n\n module.forEachMutation(function (mutation, key) {\n var namespacedType = namespace + key;\n registerMutation(store, namespacedType, mutation, local);\n });\n\n module.forEachAction(function (action, key) {\n var type = action.root ? key : namespace + key;\n var handler = action.handler || action;\n registerAction(store, type, handler, local);\n });\n\n module.forEachGetter(function (getter, key) {\n var namespacedType = namespace + key;\n registerGetter(store, namespacedType, getter, local);\n });\n\n module.forEachChild(function (child, key) {\n installModule(store, rootState, path.concat(key), child, hot);\n });\n }\n\n /**\n * make localized dispatch, commit, getters and state\n * if there is no namespace, just use root ones\n */\n function makeLocalContext (store, namespace, path) {\n var noNamespace = namespace === '';\n\n var local = {\n dispatch: noNamespace ? store.dispatch : function (_type, _payload, _options) {\n var args = unifyObjectStyle(_type, _payload, _options);\n var payload = args.payload;\n var options = args.options;\n var type = args.type;\n\n if (!options || !options.root) {\n type = namespace + type;\n if (!store._actions[type]) {\n console.error((\"[vuex] unknown local action type: \" + (args.type) + \", global type: \" + type));\n return\n }\n }\n\n return store.dispatch(type, payload)\n },\n\n commit: noNamespace ? store.commit : function (_type, _payload, _options) {\n var args = unifyObjectStyle(_type, _payload, _options);\n var payload = args.payload;\n var options = args.options;\n var type = args.type;\n\n if (!options || !options.root) {\n type = namespace + type;\n if (!store._mutations[type]) {\n console.error((\"[vuex] unknown local mutation type: \" + (args.type) + \", global type: \" + type));\n return\n }\n }\n\n store.commit(type, payload, options);\n }\n };\n\n // getters and state object must be gotten lazily\n // because they will be changed by vm update\n Object.defineProperties(local, {\n getters: {\n get: noNamespace\n ? function () { return store.getters; }\n : function () { return makeLocalGetters(store, namespace); }\n },\n state: {\n get: function () { return getNestedState(store.state, path); }\n }\n });\n\n return local\n }\n\n function makeLocalGetters (store, namespace) {\n var gettersProxy = {};\n\n var splitPos = namespace.length;\n Object.keys(store.getters).forEach(function (type) {\n // skip if the target getter is not match this namespace\n if (type.slice(0, splitPos) !== namespace) { return }\n\n // extract local getter type\n var localType = type.slice(splitPos);\n\n // Add a port to the getters proxy.\n // Define as getter property because\n // we do not want to evaluate the getters in this time.\n Object.defineProperty(gettersProxy, localType, {\n get: function () { return store.getters[type]; },\n enumerable: true\n });\n });\n\n return gettersProxy\n }\n\n function registerMutation (store, type, handler, local) {\n var entry = store._mutations[type] || (store._mutations[type] = []);\n entry.push(function wrappedMutationHandler (payload) {\n handler.call(store, local.state, payload);\n });\n }\n\n function registerAction (store, type, handler, local) {\n var entry = store._actions[type] || (store._actions[type] = []);\n entry.push(function wrappedActionHandler (payload, cb) {\n var res = handler.call(store, {\n dispatch: local.dispatch,\n commit: local.commit,\n getters: local.getters,\n state: local.state,\n rootGetters: store.getters,\n rootState: store.state\n }, payload, cb);\n if (!isPromise(res)) {\n res = Promise.resolve(res);\n }\n if (store._devtoolHook) {\n return res.catch(function (err) {\n store._devtoolHook.emit('vuex:error', err);\n throw err\n })\n } else {\n return res\n }\n });\n }\n\n function registerGetter (store, type, rawGetter, local) {\n if (store._wrappedGetters[type]) {\n {\n console.error((\"[vuex] duplicate getter key: \" + type));\n }\n return\n }\n store._wrappedGetters[type] = function wrappedGetter (store) {\n return rawGetter(\n local.state, // local state\n local.getters, // local getters\n store.state, // root state\n store.getters // root getters\n )\n };\n }\n\n function enableStrictMode (store) {\n store._vm.$watch(function () { return this._data.$$state }, function () {\n {\n assert(store._committing, \"do not mutate vuex store state outside mutation handlers.\");\n }\n }, { deep: true, sync: true });\n }\n\n function getNestedState (state, path) {\n return path.length\n ? path.reduce(function (state, key) { return state[key]; }, state)\n : state\n }\n\n function unifyObjectStyle (type, payload, options) {\n if (isObject(type) && type.type) {\n options = payload;\n payload = type;\n type = type.type;\n }\n\n {\n assert(typeof type === 'string', (\"expects string as the type, but found \" + (typeof type) + \".\"));\n }\n\n return { type: type, payload: payload, options: options }\n }\n\n function install (_Vue) {\n if (Vue && _Vue === Vue) {\n {\n console.error(\n '[vuex] already installed. Vue.use(Vuex) should be called only once.'\n );\n }\n return\n }\n Vue = _Vue;\n applyMixin(Vue);\n }\n\n /**\n * Reduce the code which written in Vue.js for getting the state.\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} states # Object's item can be a function which accept state and getters for param, you can do something for state and getters in it.\n * @param {Object}\n */\n var mapState = normalizeNamespace(function (namespace, states) {\n var res = {};\n normalizeMap(states).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedState () {\n var state = this.$store.state;\n var getters = this.$store.getters;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapState', namespace);\n if (!module) {\n return\n }\n state = module.context.state;\n getters = module.context.getters;\n }\n return typeof val === 'function'\n ? val.call(this, state, getters)\n : state[val]\n };\n // mark vuex getter for devtools\n res[key].vuex = true;\n });\n return res\n });\n\n /**\n * Reduce the code which written in Vue.js for committing the mutation\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} mutations # Object's item can be a function which accept `commit` function as the first param, it can accept anthor params. You can commit mutation and do any other things in this function. specially, You need to pass anthor params from the mapped function.\n * @return {Object}\n */\n var mapMutations = normalizeNamespace(function (namespace, mutations) {\n var res = {};\n normalizeMap(mutations).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedMutation () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // Get the commit method from store\n var commit = this.$store.commit;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapMutations', namespace);\n if (!module) {\n return\n }\n commit = module.context.commit;\n }\n return typeof val === 'function'\n ? val.apply(this, [commit].concat(args))\n : commit.apply(this.$store, [val].concat(args))\n };\n });\n return res\n });\n\n /**\n * Reduce the code which written in Vue.js for getting the getters\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} getters\n * @return {Object}\n */\n var mapGetters = normalizeNamespace(function (namespace, getters) {\n var res = {};\n normalizeMap(getters).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n // The namespace has been mutated by normalizeNamespace\n val = namespace + val;\n res[key] = function mappedGetter () {\n if (namespace && !getModuleByNamespace(this.$store, 'mapGetters', namespace)) {\n return\n }\n if (!(val in this.$store.getters)) {\n console.error((\"[vuex] unknown getter: \" + val));\n return\n }\n return this.$store.getters[val]\n };\n // mark vuex getter for devtools\n res[key].vuex = true;\n });\n return res\n });\n\n /**\n * Reduce the code which written in Vue.js for dispatch the action\n * @param {String} [namespace] - Module's namespace\n * @param {Object|Array} actions # Object's item can be a function which accept `dispatch` function as the first param, it can accept anthor params. You can dispatch action and do any other things in this function. specially, You need to pass anthor params from the mapped function.\n * @return {Object}\n */\n var mapActions = normalizeNamespace(function (namespace, actions) {\n var res = {};\n normalizeMap(actions).forEach(function (ref) {\n var key = ref.key;\n var val = ref.val;\n\n res[key] = function mappedAction () {\n var args = [], len = arguments.length;\n while ( len-- ) args[ len ] = arguments[ len ];\n\n // get dispatch function from store\n var dispatch = this.$store.dispatch;\n if (namespace) {\n var module = getModuleByNamespace(this.$store, 'mapActions', namespace);\n if (!module) {\n return\n }\n dispatch = module.context.dispatch;\n }\n return typeof val === 'function'\n ? val.apply(this, [dispatch].concat(args))\n : dispatch.apply(this.$store, [val].concat(args))\n };\n });\n return res\n });\n\n /**\n * Rebinding namespace param for mapXXX function in special scoped, and return them by simple object\n * @param {String} namespace\n * @return {Object}\n */\n var createNamespacedHelpers = function (namespace) { return ({\n mapState: mapState.bind(null, namespace),\n mapGetters: mapGetters.bind(null, namespace),\n mapMutations: mapMutations.bind(null, namespace),\n mapActions: mapActions.bind(null, namespace)\n }); };\n\n /**\n * Normalize the map\n * normalizeMap([1, 2, 3]) => [ { key: 1, val: 1 }, { key: 2, val: 2 }, { key: 3, val: 3 } ]\n * normalizeMap({a: 1, b: 2, c: 3}) => [ { key: 'a', val: 1 }, { key: 'b', val: 2 }, { key: 'c', val: 3 } ]\n * @param {Array|Object} map\n * @return {Object}\n */\n function normalizeMap (map) {\n return Array.isArray(map)\n ? map.map(function (key) { return ({ key: key, val: key }); })\n : Object.keys(map).map(function (key) { return ({ key: key, val: map[key] }); })\n }\n\n /**\n * Return a function expect two param contains namespace and map. it will normalize the namespace and then the param's function will handle the new namespace and the map.\n * @param {Function} fn\n * @return {Function}\n */\n function normalizeNamespace (fn) {\n return function (namespace, map) {\n if (typeof namespace !== 'string') {\n map = namespace;\n namespace = '';\n } else if (namespace.charAt(namespace.length - 1) !== '/') {\n namespace += '/';\n }\n return fn(namespace, map)\n }\n }\n\n /**\n * Search a special module from store by namespace. if module not exist, print error message.\n * @param {Object} store\n * @param {String} helper\n * @param {String} namespace\n * @return {Object}\n */\n function getModuleByNamespace (store, helper, namespace) {\n var module = store._modulesNamespaceMap[namespace];\n if (!module) {\n console.error((\"[vuex] module namespace not found in \" + helper + \"(): \" + namespace));\n }\n return module\n }\n\n var index = {\n Store: Store,\n install: install,\n version: '3.1.1',\n mapState: mapState,\n mapMutations: mapMutations,\n mapGetters: mapGetters,\n mapActions: mapActions,\n createNamespacedHelpers: createNamespacedHelpers\n };\n\n return index;\n\n}));","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n"],"sourceRoot":""}