diff --git a/application/modules/default/controllers/ProductController.php b/application/modules/default/controllers/ProductController.php index c17857893..78c669c99 100644 --- a/application/modules/default/controllers/ProductController.php +++ b/application/modules/default/controllers/ProductController.php @@ -1,3313 +1,3366 @@ . **/ class ProductController extends Local_Controller_Action_DomainSwitch { const IMAGE_SMALL_UPLOAD = 'image_small_upload'; const IMAGE_BIG_UPLOAD = 'image_big_upload'; /** * Zend_Controller_Request_Abstract object wrapping the request environment * * @var Zend_Controller_Request_Http */ protected $_request = null; /** @var int */ protected $_projectId; /** @var int */ protected $_collectionId; /** @var Zend_Auth */ protected $_auth; /** @var string */ protected $_browserTitlePrepend; public function init() { parent::init(); $this->_projectId = (int)$this->getParam('project_id'); $this->_collectionId = (int)$this->getParam('collection_id'); $this->_auth = Zend_Auth::getInstance(); $this->_browserTitlePrepend = $this->templateConfigData['head']['browser_title_prepend']; $action = $this->getRequest()->getActionName(); $title = $action; if($action =='add') { $title = 'add product'; }else { $title = $action; } $this->view->headTitle($title . ' - ' . $this->getHeadTitle(), 'SET'); } public function ratingAction() { $this->_helper->layout()->disableLayout(); if (array_key_exists($this->_projectId, $this->_authMember->projects)) { return; } $userRating = (int)$this->getParam('rate', 0); $modelRating = new Default_Model_DbTable_ProjectRating(); $modelRating->rateForProject($this->_projectId, $this->_authMember->member_id, $userRating); } public function pploadAction() { $this->_helper->layout->disableLayout(); $modelProduct = new Default_Model_Project(); $productInfo = $modelProduct->fetchProductInfo($this->_projectId); //create ppload download hash: secret + collection_id + expire-timestamp $salt = PPLOAD_DOWNLOAD_SECRET; $collectionID = $productInfo->ppload_collection_id; $timestamp = time() + 3600; // one hour valid //20181009 ronald: change hash from MD5 to SHA512 //$hash = md5($salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying $hash = hash('sha512',$salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying $this->view->download_hash = $hash; $this->view->download_timestamp = $timestamp; $this->view->product = $productInfo; $this->_helper->viewRenderer('/partials/pploadajax'); } public function gettaggroupsforcatajaxAction() { $this->_helper->layout()->disableLayout(); $catId = null; $fileId = null; if($this->hasParam('file_id')) { $fileId = $this->getParam('file_id'); } if($this->hasParam('project_cat_id')) { $catId = $this->getParam('project_cat_id'); $catTagModel = new Default_Model_Tags(); $catTagGropuModel = new Default_Model_TagGroup(); $tagGroups = $catTagGropuModel->fetchTagGroupsForCategory($catId); $tableTags = new Default_Model_DbTable_Tags(); $result = array(); $resultGroup = array(); foreach ($tagGroups as $group) { $tags = $tableTags->fetchForGroupForSelect($group['tag_group_id']); $selectedTags = null; if(!empty($fileId)) { $selectedTags = $catTagModel->getTagsArray($fileId, Default_Model_DbTable_Tags::TAG_TYPE_FILE,$group['tag_group_id']); } $group['tag_list'] = $tags; $group['selected_tags'] = $selectedTags; $result[] = $group; } $this->_helper->json(array('status' => 'ok', 'ResultSize' => count($tagGroups), 'tag_groups' => $result)); return; } $this->_helper->json(array('status' => 'error')); } private function getTagGroupsForCat($fileId) { $modelProduct = new Default_Model_Project(); $productInfo = $modelProduct->fetchProductInfo($this->_projectId); $catId = $productInfo->project_category_id; if(!empty($catId)) { $catTagModel = new Default_Model_Tags(); $catTagGropuModel = new Default_Model_TagGroup(); $tagGroups = $catTagGropuModel->fetchTagGroupsForCategory($catId); $tableTags = new Default_Model_DbTable_Tags(); $result = array(); foreach ($tagGroups as $group) { $tags = $tableTags->fetchForGroupForSelect($group['tag_group_id']); $selectedTags = null; if(!empty($fileId)) { $selectedTags = $catTagModel->getTagsArray($fileId, Default_Model_DbTable_Tags::TAG_TYPE_FILE,$group['tag_group_id']); } $group['tag_list'] = $tags; $group['selected_tags'] = $selectedTags; $result[] = $group; } return $result; } return null; } private function getFileDownloadCount($collection_id, $fileId) { $modelFiles = new Default_Model_DbTable_PploadFiles(); $countAll = $modelFiles->fetchCountDownloadsForFileAllTime($collection_id, $fileId); $countToday = $modelFiles->fetchCountDownloadsForFileToday($collection_id, $fileId); $count = (int)$countAll+ (int)$countToday; return $count; } public function listsamesourceurlAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(true); $modelProduct = new Default_Model_Project(); $productInfo = $modelProduct->fetchProductInfo($this->_projectId); $result = $modelProduct->getSourceUrlProjects($productInfo->source_url); $r = '
'; foreach ($result as $value) { $r=$r.'
' .'
'.$value['title'].'
' .'' .'
'.$value['created_at'].'
' .'
'.$value['changed_at'].'
' .'
'; } $r = $r.'
'; /*$response='';*/ echo $r; } public function getfilesajaxAction() { $this->_helper->layout()->disableLayout(); $collection_id = null; $file_status = null; $ignore_status_code = null; $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); if($this->hasParam('status')) { $file_status = $this->getParam('status'); } if($this->hasParam('ignore_status_code')) { $ignore_status_code = $this->getParam('ignore_status_code'); } $filesTable = new Default_Model_DbTable_PploadFiles(); if($this->hasParam('collection_id')) { $collection_id = $this->getParam('collection_id'); $result = array(); $isForAdmin = false; if ($userRoleName == Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN) { $isForAdmin = true; } //Load files from DB if($ignore_status_code == 0 && $file_status == 'active') { $files = $filesTable->fetchAllActiveFilesForProject($collection_id, $isForAdmin); } else { $files = $filesTable->fetchAllFilesForProject($collection_id, $isForAdmin); } //Check, if the project category has tag-grous $modelProduct = new Default_Model_Project(); $productInfo = $modelProduct->fetchProductInfo($this->_projectId); $catTagGropuModel = new Default_Model_TagGroup(); $tagGroups = $catTagGropuModel->fetchTagGroupsForCategory($productInfo->project_category_id); foreach ($files as $file) { //add tag grous, if needed if(!empty($tagGroups)) { $groups = $this->getTagGroupsForCat($file['id']); $file['tag_groups'] = $groups; } //Download Counter //new counter IP based $counterUkAll = $file['count_dl_all_uk']; $counterNoUkAll = $file['count_dl_all_nouk']; $counterUkToday = $file['count_dl_uk_today']; $counterNew = 0; if(!empty($counterUkAll)) { $counterNew = $counterNew + $counterUkAll; } if(!empty($counterUkToday)) { $counterNew = $counterNew + $counterUkToday; } if(!empty($counterNoUkAll)) { $counterNew = $counterNew + $counterNoUkAll; } $file['downloaded_count_uk'] = $counterNew; if ($userRoleName == Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN) { //$file['downloaded_count_live'] = $this->getFileDownloadCount($collection_id, $file['id']); $counterToday = $file['count_dl_today']; $counterAll = $file['count_dl_all']; $counter = 0; if(!empty($counterToday)) { $counter = $counterToday; } if(!empty($counterAll)) { $counter = $counter + $counterAll; } $file['downloaded_count_live'] = $counter; } else { unset($file['count_dl_all']); unset($file['count_dl_all_nouk']); unset($file['count_dl_all_uk']); unset($file['count_dl_uk_today']); unset($file['count_dl_today']); unset($file['downloaded_count']); } $result[] = $file; } $this->_helper->json(array('status' => 'success', 'ResultSize' => count($result), 'files' => $result)); return; } $this->_helper->json(array('status' => 'error')); } public function getfiletagsajaxAction() { $this->_helper->layout()->disableLayout(); $fileId = null; if($this->hasParam('file_id')) { $fileId = $this->getParam('file_id'); $tagModel = new Default_Model_Tags(); $fileTags = $tagModel->getFileTags($fileId); $this->_helper->json(array('status' => 'ok', 'ResultSize' => count($fileTags), 'file_tags' => $fileTags)); return; } $this->_helper->json(array('status' => 'error')); } public function initJsonForReact(){ $modelProduct = new Default_Model_Project(); $productInfo = $modelProduct->fetchProductInfo($this->_projectId); $this->view->product = $productInfo; if (empty($this->view->product)) { throw new Zend_Controller_Action_Exception('This page does not exist', 404); } if(null != $this->_authMember) { $this->view->authMemberJson = Zend_Json::encode( Default_Model_Member::cleanAuthMemberForJson($this->_authMember) ); } $helpAddDefaultScheme = new Default_View_Helper_AddDefaultScheme(); $this->view->product->title = Default_Model_HtmlPurify::purify($this->view->product->title); $this->view->product->description = Default_Model_BBCode::renderHtml(Default_Model_HtmlPurify::purify($this->view->product->description)); $this->view->product->version = Default_Model_HtmlPurify::purify($this->view->product->version); $this->view->product->link_1 = Default_Model_HtmlPurify::purify($helpAddDefaultScheme->addDefaultScheme($this->view->product->link_1),Default_Model_HtmlPurify::ALLOW_URL); $this->view->product->source_url = Default_Model_HtmlPurify::purify($this->view->product->source_url,Default_Model_HtmlPurify::ALLOW_URL); $this->view->product->facebook_code = Default_Model_HtmlPurify::purify($this->view->product->facebook_code,Default_Model_HtmlPurify::ALLOW_URL); $this->view->product->twitter_code = Default_Model_HtmlPurify::purify($this->view->product->twitter_code,Default_Model_HtmlPurify::ALLOW_URL); $this->view->product->google_code = Default_Model_HtmlPurify::purify($this->view->product->google_code,Default_Model_HtmlPurify::ALLOW_URL); $this->view->productJson = Zend_Json::encode(Default_Model_Collection::cleanProductInfoForJson($this->view->product) ); $fmodel =new Default_Model_DbTable_PploadFiles(); $files = $fmodel->fetchFilesForProject($this->view->product->ppload_collection_id); $salt = PPLOAD_DOWNLOAD_SECRET; $filesList = array(); foreach ($files as $file) { $timestamp = time() + 3600; // one hour valid $hash = hash('sha512',$salt . $file['collection_id'] . $timestamp); // order isn't important at all... just do the same when verifying $url = PPLOAD_API_URI . 'files/download/id/' . $file['id'] . '/s/' . $hash . '/t/' . $timestamp; if(null != $this->_authMember) { $url .= '/u/' . $this->_authMember->member_id; } $url .= '/lt/filepreview/' . $file['name']; $file['url'] = urlencode($url); $filesList[] = $file; } $this->view->filesJson = Zend_Json::encode($filesList); $this->view->filesCntJson = Zend_Json::encode($fmodel->fetchFilesCntForProject($this->view->product->ppload_collection_id)); $tableProjectUpdates = new Default_Model_ProjectUpdates(); $this->view->updatesJson = Zend_Json::encode($tableProjectUpdates->fetchProjectUpdates($this->_projectId)); $tableProjectRatings = new Default_Model_DbTable_ProjectRating(); $ratings = $tableProjectRatings->fetchRating($this->_projectId); $cntRatingsActive = 0; foreach ($ratings as $p) { if($p['rating_active']==1) $cntRatingsActive =$cntRatingsActive+1; } $this->view->ratingsJson = Zend_Json::encode($ratings); $this->view->cntRatingsActiveJson = Zend_Json::encode($cntRatingsActive); $identity = Zend_Auth::getInstance()->getStorage()->read(); if (Zend_Auth::getInstance()->hasIdentity()){ $ratingOfUserJson = $tableProjectRatings->getProjectRateForUser($this->_projectId,$identity->member_id); $this->view->ratingOfUserJson = Zend_Json::encode($ratingOfUserJson); }else{ $this->view->ratingOfUserJson = Zend_Json::encode(null); } $tableProjectFollower = new Default_Model_DbTable_ProjectFollower(); $likes = $tableProjectFollower->fetchLikesForProject($this->_projectId); $this->view->likeJson = Zend_Json::encode($likes); $projectplings = new Default_Model_ProjectPlings(); $plings = $projectplings->fetchPlingsForProject($this->_projectId); $this->view->projectplingsJson = Zend_Json::encode($plings); $tableProject = new Default_Model_Project(); $galleryPictures = $tableProject->getGalleryPictureSources($this->_projectId); $this->view->galleryPicturesJson = Zend_Json::encode($galleryPictures); $tagmodel = new Default_Model_Tags(); $tagsuser = $tagmodel->getTagsUser($this->_projectId, Default_Model_Tags::TAG_TYPE_PROJECT); $tagssystem = $tagmodel->getTagsSystemList($this->_projectId); $this->view->tagsuserJson = Zend_Json::encode($tagsuser); $this->view->tagssystemJson = Zend_Json::encode($tagssystem); $modelComments = new Default_Model_ProjectComments(); $offset = 0; $testComments = $modelComments->getCommentTreeForProjectList($this->_projectId); $this->view->commentsJson = Zend_Json::encode($testComments); $modelClone = new Default_Model_ProjectClone(); $origins = $modelClone->fetchOrigins($this->_projectId); $this->view->originsJson = Zend_Json::encode($origins); $related = $modelClone->fetchRelatedProducts($this->_projectId); $this->view->relatedJson = Zend_Json::encode($related); $moreProducts = $tableProject->fetchMoreProjects($this->view->product, 8); $this->view->moreProductsJson = Zend_Json::encode($moreProducts); $moreProducts = $tableProject->fetchMoreProjectsOfOtherUsr($this->view->product, 8); $this->view->moreProductsOfOtherUsrJson = Zend_Json::encode($moreProducts); } public function indexAction() { if (!empty($this->_collectionId)) { $modelProduct = new Default_Model_Project(); $productInfo = $modelProduct->fetchProductForCollectionId($this->_collectionId); $this->_projectId = $productInfo->project_id; } if (empty($this->_projectId)) { $this->redirect('/explore'); } $this->view->paramPageId = (int)$this->getParam('page'); $this->view->member_id = null; if(null != $this->_authMember && null != $this->_authMember->member_id) { $this->view->member_id = $this->_authMember->member_id; } // $this->fetchDataForIndexView(); $modelProduct = new Default_Model_Project(); $productInfo = $modelProduct->fetchProductInfo($this->_projectId); if (empty($productInfo)) { throw new Zend_Controller_Action_Exception('This page does not exist', 404); } //Check if this is a collection if($productInfo->type_id == $modelProduct::PROJECT_TYPE_COLLECTION) { $this->redirect('/c/'.$this->_projectId); } $this->view->product = $productInfo; $this->view->headTitle($productInfo->title . ' - ' . $this->getHeadTitle(), 'SET'); $this->view->cat_id = $this->view->product->project_category_id; $tagGroupFilter = Zend_Registry::isRegistered('config_store_taggroups') ? Zend_Registry::get('config_store_taggroups') : null; if(!empty($tagGroupFilter)) { $filterArray = array(); foreach ($tagGroupFilter as $tagGroupId) { $inputFilter = $this->getFilterTagFromCookie($tagGroupId); $filterArray[$tagGroupId] = $inputFilter; } $this->view->tag_group_filter = $filterArray; } //create ppload download hash: secret + collection_id + expire-timestamp $salt = PPLOAD_DOWNLOAD_SECRET; $collectionID = $this->view->product->ppload_collection_id; $timestamp = time() + 3600; // one hour valid //20181009 ronald: change hash from MD5 to SHA512 //$hash = md5($salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying $hash = hash('sha512',$salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying $this->view->download_hash = $hash; $this->view->download_timestamp = $timestamp; $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); $isAdmin = false; if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { $isAdmin = true; } $helperUserIsOwner = new Default_View_Helper_UserIsOwner(); $helperIsProjectActive = new Default_View_Helper_IsProjectActive(); if (!$isAdmin AND (false === $helperIsProjectActive->isProjectActive($this->view->product->project_status)) AND (false === $helperUserIsOwner->UserIsOwner($this->view->product->member_id)) ) { throw new Zend_Controller_Action_Exception('This page does not exist', 404); } if (APPLICATION_ENV != 'searchbotenv') { $tablePageViews = new Default_Model_DbTable_StatPageViews(); $tablePageViews->savePageView($this->_projectId, $this->getRequest()->getClientIp(), $this->_authMember->member_id); } $fmodel =new Default_Model_DbTable_PploadFiles(); $filesList = array(); if(isset($this->view->product->ppload_collection_id)) { $files = $fmodel->fetchFilesForProject($this->view->product->ppload_collection_id); if(!empty($files)) { foreach ($files as $file) { $timestamp = time() + 3600; // one hour valid $hash = hash('sha512',$salt . $file['collection_id'] . $timestamp); // order isn't important at all... just do the same when verifying $url = PPLOAD_API_URI . 'files/download/id/' . $file['id'] . '/s/' . $hash . '/t/' . $timestamp; if(null != $this->_authMember) { $url .= '/u/' . $this->_authMember->member_id; } $url .= '/lt/filepreview/' . $file['name']; $file['url'] = urlencode($url); //If this file is a video, we have to convert it for preview if(!empty($file['type']) && in_array($file['type'], Backend_Commands_ConvertVideo::$VIDEO_FILE_TYPES) && empty($file['ppload_file_preview_id'])) { $queue = Local_Queue_Factory::getQueue(); $command = new Backend_Commands_ConvertVideo($file['collection_id'], $file['id'], $file['type']); $queue->send(serialize($command)); } if(!empty($file['url_preview'])) { $file['url_preview'] = urlencode($file['url_preview']); } if(!empty($file['url_thumb'])) { $file['url_thumb'] = urlencode($file['url_thumb']); } $filesList[] = $file; } } } $this->view->filesJson = Zend_Json::encode($filesList); //gitlab if($this->view->product->is_gitlab_project) { $gitProject = $this->fetchGitlabProject($this->view->product->gitlab_project_id); if(null == $gitProject) { $this->view->product->is_gitlab_project = 0; $this->view->product->show_gitlab_project_issues = 0; $this->view->product->use_gitlab_project_readme = 0; $this->view->product->gitlab_project_id = null; } else { $this->view->gitlab_project = $gitProject; //show issues? if($this->view->product->show_gitlab_project_issues) { $issues = $this->fetchGitlabProjectIssues($this->view->product->gitlab_project_id); $this->view->gitlab_project_issues = $issues; $this->view->gitlab_project_issues_url = $this->view->gitlab_project['web_url'] . '/issues/'; } //show readme.md? if($this->view->product->use_gitlab_project_readme && null != $this->view->gitlab_project['readme_url']) { $config = Zend_Registry::get('config')->settings->server->opencode; $readme = $this->view->gitlab_project['web_url'].'/raw/master/README.md?inline=false'; $httpClient = new Zend_Http_Client($readme, array('keepalive' => true, 'strictredirects' => true)); $httpClient->resetParameters(); $httpClient->setUri($readme); $httpClient->setHeaders('Private-Token', $config->private_token); $httpClient->setHeaders('Sudo', $config->user_sudo); $httpClient->setHeaders('User-Agent', $config->user_agent); $httpClient->setMethod(Zend_Http_Client::GET); $response = $httpClient->request(); $body = $response->getRawBody(); if (count($body) == 0) { return array(); } include_once('Parsedown.php'); $Parsedown = new Parsedown(); $this->view->readme = $Parsedown->text($body); } else { $this->view->readme = null; } } } // products related $pc = new Default_Model_ProjectClone(); $cntRelatedProducts=0; $ancesters = $pc->fetchAncestersIds($this->_projectId); //$siblings = $pc->fetchSiblings($this->_projectId); //$parents = $pc->fetchParentIds($this->_projectId); if($ancesters && strlen($ancesters)>0){ $parents = $pc->fetchParentLevelRelatives($this->_projectId); }else{ $parents = $pc->fetchParentIds($this->_projectId); } if($parents && strlen($parents)>0) { $siblings = $pc->fetchSiblingsLevelRelatives($parents, $this->_projectId); }else { $siblings = null; } $childrens = $pc->fetchChildrensIds($this->_projectId); $childrens2 = null; $childrens3 = null; if(strlen($childrens)>0) { $childrens2 = $pc->fetchChildrensChildrenIds($childrens); if(strlen($childrens2)>0) { $childrens3 = $pc->fetchChildrensChildrenIds($childrens2); } } $this->view->related_ancesters = null; $this->view->related_siblings = null; $this->view->related_parents = null; $this->view->related_children = null; $this->view->related_children2 = null; $this->view->related_children3 = null; if($ancesters && strlen($ancesters)>0){ $pts = $modelProduct->fetchProjects($ancesters); $this->view->related_ancesters = sizeof($pts)==0?null:$pts; $cntRelatedProducts+= sizeof($pts); } if($siblings && strlen($siblings)>0){ $pts = $modelProduct->fetchProjects($siblings); $this->view->related_siblings = sizeof($pts)==0?null:$pts; $cntRelatedProducts+= sizeof($pts); } if($parents && strlen($parents)>0){ $pts = $modelProduct->fetchProjects($parents); $this->view->related_parents = sizeof($pts)==0?null:$pts; $cntRelatedProducts+= sizeof($pts); } if($childrens && strlen($childrens)>0){ $pts = $modelProduct->fetchProjects($childrens); $this->view->related_children = sizeof($pts)==0?null:$pts; $cntRelatedProducts+= sizeof($pts); } if($childrens2 && strlen($childrens2)>0){ $pts = $modelProduct->fetchProjects($childrens2); $this->view->related_children2 = sizeof($pts)==0?null:$pts; $cntRelatedProducts+= sizeof($pts); } if($childrens3 && strlen($childrens3)>0){ $pts = $modelProduct->fetchProjects($childrens3); $this->view->related_children3 = sizeof($pts)==0?null:$pts; $cntRelatedProducts+= sizeof($pts); } $this->view->cntRelatedProducts = $cntRelatedProducts; $storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null; if($storeConfig->layout_pagedetail && $storeConfig->isRenderReact()){ $this->initJsonForReact(); $this->_helper->viewRenderer('index-react'); } } public function showAction() { $this->view->authMember = $this->_authMember; $this->_helper->viewRenderer('index'); $this->indexAction(); } public function addAction() { $this->view->member = $this->_authMember; $this->view->mode = 'add'; if($this->getParam('catId')){ $this->view->catId = $this->getParam('catId'); } $form = new Default_Form_Product(array('member_id' => $this->view->member->member_id)); $this->view->form = $form; if ($this->_request->isGet()) { return; } $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); $isAdmin = false; if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { $isAdmin = true; } if (isset($_POST['cancel'])) { // user cancel function $this->redirect('/member/' . $this->_authMember->member_id . '/news/'); } if (false === $form->isValid($_POST)) { // form not valid $this->view->form = $form; $this->view->error = 1; return; } $values = $form->getValues(); $imageModel = new Default_Model_DbTable_Image(); try { $values['image_small'] = $imageModel->saveImage($form->getElement(self::IMAGE_SMALL_UPLOAD)); } catch (Exception $e) { Zend_Registry::get('logger')->err(__METHOD__ . ' - ERROR upload productPicture - ' . print_r($e, true)); } // form was valid, so we can set status to active $values['status'] = Default_Model_DbTable_Project::PROJECT_ACTIVE; // save new project $modelProject = new Default_Model_Project(); Zend_Registry::get('logger')->info(__METHOD__ . ' - $post: ' . print_r($_POST, true)); Zend_Registry::get('logger')->info(__METHOD__ . ' - $files: ' . print_r($_FILES, true)); Zend_Registry::get('logger')->info(__METHOD__ . ' - input values: ' . print_r($values, true)); $newProject = null; try { if (isset($values['project_id'])) { $newProject = $modelProject->updateProject($values['project_id'], $values); } else { $newProject = $modelProject->createProject($this->_authMember->member_id, $values, $this->_authMember->username); //$this->createSystemPlingForNewProject($newProject->project_id); } } catch (Exception $exc) { Zend_Registry::get('logger')->warn(__METHOD__ . ' - traceString: ' . $exc->getTraceAsString()); } if (!$newProject) { $this->_helper->flashMessenger->addMessage('

You did not choose a Category in the last level.

'); $this->forward('add'); return; } //update the gallery pics $mediaServerUrls = $this->saveGalleryPics($form->gallery->upload->upload_picture); $modelProject->updateGalleryPictures($newProject->project_id, $mediaServerUrls); //If there is no Logo, we take the 1. gallery pic if (!isset($values['image_small']) || $values['image_small'] == '') { $values['image_small'] = $mediaServerUrls[0]; $newProject = $modelProject->updateProject($newProject->project_id, $values); } //New Project in Session, for AuthValidation (owner) $this->_auth->getIdentity()->projects[$newProject->project_id] = array('project_id' => $newProject->project_id); $modelTags = new Default_Model_Tags(); if ($values['tagsuser']) { $modelTags->processTagsUser($newProject->project_id, implode(',', $values['tagsuser']),Default_Model_Tags::TAG_TYPE_PROJECT); } else { $modelTags->processTagsUser($newProject->project_id, null, Default_Model_Tags::TAG_TYPE_PROJECT); } $modelTags->processTagProductOriginalOrModification($newProject->project_id,$values['is_original_or_modification'][0]); //set license, if needed $licenseTag = $form->getElement('license_tag_id')->getValue(); //only set/update license tags if something was changed if ($licenseTag && count($licenseTag) > 0) { $modelTags->saveLicenseTagForProject($newProject->project_id, $licenseTag); $activityLog = new Default_Model_ActivityLog(); $activityLog->logActivity($newProject->project_id, $newProject->project_id, $this->_authMember->member_id,Default_Model_ActivityLog::PROJECT_LICENSE_CHANGED, array('title' => 'Set new License Tag', 'description' => 'New TagId: ' . $licenseTag)); } $isGitlabProject = $form->getElement('is_gitlab_project')->getValue(); $gitlabProjectId = $form->getElement('gitlab_project_id')->getValue(); if ($isGitlabProject && $gitlabProjectId == 0) { $values['gitlab_project_id'] = null; } $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($newProject->project_id, $newProject->member_id, Default_Model_ActivityLog::PROJECT_CREATED, $newProject->toArray()); // ppload $this->processPploadId($newProject); try { if (100 < $this->_authMember->roleId) { if (Default_Model_Spam::hasSpamMarkers($newProject->toArray())) { $tableReportComments = new Default_Model_DbTable_ReportProducts(); $tableReportComments->save(array('project_id' => $newProject->project_id, 'reported_by' => 24, 'text' => "System: automatic spam detection")); } Default_Model_DbTable_SuspicionLog::logProject($newProject, $this->_authMember, $this->getRequest()); } } catch (Zend_Exception $e) { Zend_Registry::get('logger')->err($e->getMessage()); } $this->redirect('/member/' . $newProject->member_id . '/products/'); } private function saveGalleryPics($form_element) { $imageModel = new Default_Model_DbTable_Image(); return $imageModel->saveImages($form_element); } /** * @param $projectData * * @throws Zend_Exception * @throws Zend_Queue_Exception */ protected function createTaskWebsiteOwnerVerification($projectData) { if (empty($projectData->link_1)) { return; } $checkAuthCode = new Local_Verification_WebsiteProject(); $authCode = $checkAuthCode->generateAuthCode(stripslashes($projectData->link_1)); $queue = Local_Queue_Factory::getQueue(); $command = new Backend_Commands_CheckProjectWebsite($projectData->project_id, $projectData->link_1, $authCode); $queue->send(serialize($command)); } /** * @param $projectData */ protected function processPploadId($projectData) { if ($projectData->ppload_collection_id) { $pploadApi = new Ppload_Api(array( 'apiUri' => PPLOAD_API_URI, 'clientId' => PPLOAD_CLIENT_ID, 'secret' => PPLOAD_SECRET )); // Update collection information $collectionCategory = $projectData->project_category_id; if (Default_Model_Project::PROJECT_ACTIVE == $projectData->status) { $collectionCategory .= '-published'; } $collectionRequest = array( 'title' => $projectData->title, 'description' => $projectData->description, 'category' => $collectionCategory, 'content_id' => $projectData->project_id ); $collectionResponse = $pploadApi->putCollection($projectData->ppload_collection_id, $collectionRequest); // Store product image as collection thumbnail $this->_updatePploadMediaCollectionthumbnail($projectData); } } /** * ppload */ protected function _updatePploadMediaCollectionthumbnail($projectData) { if (empty($projectData->ppload_collection_id) || empty($projectData->image_small) ) { return false; } $pploadApi = new Ppload_Api(array( 'apiUri' => PPLOAD_API_URI, 'clientId' => PPLOAD_CLIENT_ID, 'secret' => PPLOAD_SECRET )); $filename = sys_get_temp_dir() . '/' . $projectData->image_small; if (false === file_exists(dirname($filename))) { mkdir(dirname($filename), 0777, true); } $viewHelperImage = new Default_View_Helper_Image(); $uri = $viewHelperImage->Image($projectData->image_small, array( 'width' => 600, 'height' => 600 )); file_put_contents($filename, file_get_contents($uri)); $mediaCollectionthumbnailResponse = $pploadApi->postMediaCollectionthumbnail($projectData->ppload_collection_id, array('file' => $filename)); unlink($filename); if (isset($mediaCollectionthumbnailResponse->status) && $mediaCollectionthumbnailResponse->status == 'success' ) { return true; } return false; } public function editAction() { if (empty($this->_projectId)) { $this->redirect($this->_helper->url('add')); return; } $this->_helper->viewRenderer('add'); // we use the same view as you can see at add a product $this->view->mode = 'edit'; $projectTable = new Default_Model_DbTable_Project(); $projectModel = new Default_Model_Project(); $modelTags = new Default_Model_Tags(); $tagTable = new Default_Model_DbTable_Tags(); //check if product with given id exists $projectData = $projectTable->find($this->_projectId)->current(); if (empty($projectData)) { $this->redirect($this->_helper->url('add')); return; } $member = null; if (isset($this->_authMember) AND (false === empty($this->_authMember->member_id))) { $member = $this->_authMember; } else { throw new Zend_Controller_Action_Exception('no authorization found'); } if (("admin" == $this->_authMember->roleName)) { $modelMember = new Default_Model_Member(); $member = $modelMember->fetchMember($projectData->member_id, false); } $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); $isAdmin = false; if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { $isAdmin = true; } //set ppload-collection-id in view $this->view->ppload_collection_id = $projectData->ppload_collection_id; $this->view->project_id = $projectData->project_id; $this->view->product = $projectData; //create ppload download hash: secret + collection_id + expire-timestamp $salt = PPLOAD_DOWNLOAD_SECRET; $collectionID = $projectData->ppload_collection_id; $timestamp = time() + 3600; // one hour valid //20181009 ronald: change hash from MD5 to SHA512 //$hash = md5($salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying $hash = hash('sha512',$salt . $collectionID . $timestamp); // order isn't important at all... just do the same when verifying $this->view->download_hash = $hash; $this->view->download_timestamp = $timestamp; $this->view->member_id = $member->member_id; $this->view->member = $member; //read the already existing gallery pics and add them to the form $sources = $projectModel->getGalleryPictureSources($this->_projectId); //get the gitlab projects for this user //setup form $form = new Default_Form_Product(array('pictures' => $sources, 'member_id' => $this->view->member_id)); if (false === empty($projectData->image_small)) { $form->getElement('image_small_upload')->setRequired(false); } $form->getElement('preview')->setLabel('Save'); $form->removeElement('project_id'); // we don't need this field in edit mode if ($this->_request->isGet()) { $form->populate($projectData->toArray()); // $form->populate(array('tags' => $modelTags->getTags($projectData->project_id, Default_Model_Tags::TAG_TYPE_PROJECT))); $form->populate(array('tagsuser' => $modelTags->getTagsUser($projectData->project_id, Default_Model_Tags::TAG_TYPE_PROJECT))); $form->getElement('image_small')->setValue($projectData->image_small); //Bilder voreinstellen $form->getElement(self::IMAGE_SMALL_UPLOAD)->setValue($projectData->image_small); $licenseTags = $tagTable->fetchLicenseTagsForProject($this->_projectId); $licenseTag = null; if($licenseTags) { $licenseTag = $licenseTags[0]['tag_id']; } $form->getElement('license_tag_id')->setValue($licenseTag); $is_original = $modelTags->isProductOriginal($projectData->project_id); $is_modification = $modelTags->isProductModification($projectData->project_id); if($is_original){ $form->getElement('is_original_or_modification')->setValue(1); } else if($is_modification){ $form->getElement('is_original_or_modification')->setValue(2); } $this->view->form = $form; return; } if (isset($_POST['cancel'])) { // user cancel function $this->redirect('/member/' . $member->member_id . '/news/'); } if (false === $form->isValid($_POST, $this->_projectId)) { // form not valid $this->view->form = $form; $this->view->error = 1; return; } $values = $form->getValues(); //set license, if needed $tagList = $modelTags->getTagsArray($this->_projectId, $modelTags::TAG_TYPE_PROJECT, $modelTags::TAG_LICENSE_GROUPID); $oldLicenseTagId = null; if($tagList && count($tagList) == 1) { $oldLicenseTagId = $tagList[0]['tag_id']; } $licenseTag = $form->getElement('license_tag_id')->getValue(); //only set/update license tags if something was changed if($licenseTag <> $oldLicenseTagId) { $modelTags->saveLicenseTagForProject($this->_projectId, $licenseTag); $activityLog = new Default_Model_ActivityLog(); $activityLog->logActivity($this->_projectId, $this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_LICENSE_CHANGED, array('title' => 'License Tag', 'description' => 'Old TagId: '.$oldLicenseTagId.' - New TagId: '.$licenseTag)); } //gitlab project $isGitlabProject = $form->getElement('is_gitlab_project')->getValue(); $gitlabProjectId = $form->getElement('gitlab_project_id')->getValue(); if($isGitlabProject && $gitlabProjectId == 0) { $values['gitlab_project_id'] = null; } $imageModel = new Default_Model_DbTable_Image(); try { $uploadedSmallImage = $imageModel->saveImage($form->getElement(self::IMAGE_SMALL_UPLOAD)); $values['image_small'] = $uploadedSmallImage ? $uploadedSmallImage : $values['image_small']; } catch (Exception $e) { Zend_Registry::get('logger')->err(__METHOD__ . ' - ERROR upload productPicture - ' . print_r($e, true)); } // save changes $projectModel->updateProject($this->_projectId, $values); //update the gallery pics $pictureSources = array_merge($values['gallery']['online_picture'], $this->saveGalleryPics($form->gallery->upload->upload_picture)); $projectModel->updateGalleryPictures($this->_projectId, $pictureSources); //If there is no Logo, we take the 1. gallery pic if (!isset($projectData->image_small) || $projectData->image_small == '') { $projectData->image_small = $pictureSources[0]; } //20180219 ronald: we set the changed_at only by new files or new updates //$projectData->changed_at = new Zend_Db_Expr('NOW()'); $projectData->save(); $modelTags->processTagProductOriginalOrModification($this->_projectId,$values['is_original_or_modification'][0]); if($values['tagsuser']) { $modelTags->processTagsUser($this->_projectId,implode(',',$values['tagsuser']), Default_Model_Tags::TAG_TYPE_PROJECT); }else { $modelTags->processTagsUser($this->_projectId,null, Default_Model_Tags::TAG_TYPE_PROJECT); } $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_EDITED, $projectData->toArray()); // ppload $this->processPploadId($projectData); try { if (100 < $this->_authMember->roleId) { if (Default_Model_Spam::hasSpamMarkers($projectData->toArray())) { $tableReportComments = new Default_Model_DbTable_ReportProducts(); $tableReportComments->save(array('project_id' => $projectData->project_id, 'reported_by' => 24, 'text' => "System: automatic spam detection on product edit")); } Default_Model_DbTable_SuspicionLog::logProject($projectData, $this->_authMember, $this->getRequest()); } } catch (Zend_Exception $e) { Zend_Registry::get('logger')->err($e->getMessage()); } $helperBuildMemberUrl = new Default_View_Helper_BuildMemberUrl(); $this->redirect($helperBuildMemberUrl->buildMemberUrl($member->username, 'products')); } public function getupdatesajaxAction() { $this->view->authMember = $this->_authMember; $tableProject = new Default_Model_ProjectUpdates(); $updates = $tableProject->fetchProjectUpdates($this->_projectId); foreach ($updates as $key => $update) { $updates[$key]['title'] = Default_Model_HtmlPurify::purify($update['title']); $updates[$key]['text'] = Default_Model_BBCode::renderHtml(Default_Model_HtmlPurify::purify(htmlentities($update['text'], ENT_QUOTES | ENT_IGNORE))); $updates[$key]['raw_title'] = $update['title']; $updates[$key]['raw_text'] = $update['text']; } $result['status'] = 'success'; $result['ResultSize'] = count($updates); $result['updates'] = $updates; $this->_helper->json($result); } public function saveupdateajaxAction() { $filter = new Zend_Filter_Input( array( '*' => 'StringTrim' ), array( '*' => array(), 'title' => array( new Zend_Validate_StringLength(array('min' => 3, 'max' => 200)), 'presence' => 'required', 'allowEmpty' => false ), 'text' => array( new Zend_Validate_StringLength(array('min' => 3, 'max' => 16383)), 'presence' => 'required', 'allowEmpty' => false ), 'update_id' => array('digits', 'allowEmpty' => true) ), $this->getAllParams(), array('allowEmpty' => true)); if ($filter->hasInvalid() OR $filter->hasMissing() OR $filter->hasUnknown()) { $result['status'] = 'error'; $result['messages'] = $filter->getMessages(); $result['update_id'] = null; $this->_helper->json($result); } $update_id = $filter->getEscaped('update_id'); $tableProjectUpdates = new Default_Model_ProjectUpdates(); //Save update if (!empty($update_id)) { //Update old update $updateArray = array(); $updateArray['title'] = $filter->getUnescaped('title'); $updateArray['text'] = $filter->getUnescaped('text'); $updateArray['changed_at'] = new Zend_Db_Expr('Now()'); $countUpdated = $tableProjectUpdates->update($updateArray, 'project_update_id = ' . $update_id); } else { //Add new update $updateArray = array(); $updateArray['title'] = $filter->getUnescaped('title'); $updateArray['text'] = $filter->getUnescaped('text'); $updateArray['public'] = 1; $updateArray['project_id'] = $this->_projectId; $updateArray['member_id'] = $this->_authMember->member_id; $updateArray['created_at'] = new Zend_Db_Expr('Now()'); $updateArray['changed_at'] = new Zend_Db_Expr('Now()'); $rowset = $tableProjectUpdates->save($updateArray); $update_id = $rowset->project_update_id; //20180219 ronald: we set the changed_at only by new files or new updates $projectTable = new Default_Model_Project(); $projectUpdateRow = $projectTable->find($this->_projectId)->current(); if (count($projectUpdateRow) == 1) { $projectUpdateRow->changed_at = new Zend_Db_Expr('NOW()'); $projectUpdateRow->save(); } } $result['status'] = 'success'; $result['update_id'] = $update_id; $this->_helper->json($result); } public function deleteupdateajaxAction() { $this->view->authMember = $this->_authMember; $tableProject = new Default_Model_ProjectUpdates(); $params = $this->getAllParams(); $project_update_id = $params['update_id']; $updateArray = array(); $updateArray['public'] = 0; $updateArray['changed_at'] = new Zend_Db_Expr('Now()'); $tableProject->update($updateArray, 'project_update_id = ' . $project_update_id); $result['status'] = 'success'; $result['update_id'] = $project_update_id; $this->_helper->json($result); } public function updatesAction() { $this->view->authMember = $this->_authMember; $tableProject = new Default_Model_Project(); $this->view->product = $tableProject->fetchProductInfo($this->_projectId); if (false === isset($this->view->product)) { throw new Zend_Controller_Action_Exception('This page does not exist', 404); } $this->view->relatedProducts = $tableProject->fetchSimilarProjects($this->view->product, 6); $this->view->supporter = $tableProject->fetchProjectSupporter($this->_projectId); $this->view->product_views = $tableProject->fetchProjectViews($this->_projectId); $modelPlings = new Default_Model_DbTable_Plings(); $this->view->comments = $modelPlings->getCommentsForProject($this->_projectId, 10); $tableMember = new Default_Model_Member(); $this->view->member = $tableMember->fetchMemberData($this->view->product->member_id); $this->view->updates = $tableProject->fetchProjectUpdates($this->_projectId); $tablePageViews = new Default_Model_DbTable_StatPageViews(); $tablePageViews->savePageView($this->_projectId, $this->getRequest()->getClientIp(), $this->_authMember->member_id); } public function updateAction() { $this->_helper->layout()->setLayout('flat_ui'); $this->view->headScript()->setFile(''); $this->view->headLink()->setStylesheet(''); $this->_helper->viewRenderer('add'); $form = new Default_Form_ProjectUpdate(); $projectTable = new Default_Model_Project(); $projectData = null; $projectUpdateId = (int)$this->getParam('upid'); $this->view->member = $this->_authMember; $this->view->title = 'Add an update for your product'; $activityLogType = Default_Model_ActivityLog::PROJECT_ITEM_CREATED; if (false === empty($projectUpdateId)) { $this->view->title = 'Edit an product update'; $projectData = $projectTable->find($projectUpdateId)->current(); $form->populate($projectData->toArray()); $form->getElement('upid')->setValue($projectUpdateId); $activityLogType = Default_Model_ActivityLog::PROJECT_ITEM_EDITED; } $this->view->form = $form; if ($this->_request->isGet()) { return; } if (isset($_POST['cancel'])) { // user cancel function $this->_redirect('/member/' . $this->_authMember->member_id . '/news/'); } if (false === $form->isValid($_POST)) { // form not valid $this->view->form = $form; $this->view->error = 1; return; } $values = $form->getValues(); $projectUpdateRow = $projectTable->find($values['upid'])->current(); if (count($projectUpdateRow) == 0) { $projectUpdateRow = $projectTable->createRow($values); $projectUpdateRow->project_id = $values['upid']; $projectUpdateRow->created_at = new Zend_Db_Expr('NOW()'); $projectUpdateRow->start_date = new Zend_Db_Expr('NOW()'); $projectUpdateRow->member_id = $this->_authMember->member_id; $projectUpdateRow->creator_id = $this->_authMember->member_id; $projectUpdateRow->status = Default_Model_Project::PROJECT_ACTIVE; $projectUpdateRow->type_id = 2; $projectUpdateRow->pid = $this->_projectId; } else { $projectUpdateRow->setFromArray($values); //20180219 ronald: we set the changed_at only by new files or new updates //$projectUpdateRow->changed_at = new Zend_Db_Expr('NOW()'); } $lastId = $projectUpdateRow->save(); //New Project in Session, for AuthValidation (owner) $this->_auth->getIdentity()->projects[$lastId] = array('project_id' => $lastId); $tableProduct = new Default_Model_Project(); $product = $tableProduct->find($this->_projectId)->current(); $activityLogValues = $projectUpdateRow->toArray(); $activityLogValues['image_small'] = $product->image_small; $activityLog = new Default_Model_ActivityLog(); //$activityLog->writeActivityLog($lastId, $projectUpdateRow->member_id, $activityLogType, $activityLogValues); $activityLog->writeActivityLog($lastId, $this->_authMember->member_id, $activityLogType, $activityLogValues); $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl(); $urlProjectShow = $helperBuildProductUrl->buildProductUrl($this->_projectId); $this->redirect($urlProjectShow); } public function previewAction() { $this->view->authMember = $this->_authMember; $form = new Default_Form_ProjectConfirm(); if ($this->_request->isGet()) { $form->populate(get_object_vars($this->_authMember)); $this->view->form = $form; $this->fetchDataForIndexView(); $this->view->preview = $this->view->render('product/index.phtml'); return; } if (isset($_POST['save'])) { $projectTable = new Default_Model_Project(); $projectTable->setStatus(Default_Model_Project::PROJECT_INACTIVE, $this->_projectId); //todo: maybe we have to delete the project data from database otherwise we produce many zombies $this->redirect('/member/' . $this->_authMember->member_id . '/products/'); } if (isset($_POST['back'])) { $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl(); $this->redirect($helperBuildProductUrl->buildProductUrl($this->_projectId, 'edit')); } if (false === $form->isValid($_POST)) { // form not valid $this->view->form = $form; $this->fetchDataForIndexView(); $this->view->preview = $this->view->render('product/index.phtml'); $this->view->error = 1; return; } $projectTable = new Default_Model_Project(); $projectTable->setStatus(Default_Model_Project::PROJECT_ACTIVE, $this->_projectId); // add to search index $modelProject = new Default_Model_Project(); $productInfo = $modelProject->fetchProductInfo($this->_projectId); $modelSearch = new Default_Model_Search_Lucene(); $modelSearch->addDocument($productInfo->toArray()); $this->redirect('/member/' . $this->_authMember->member_id . '/products/'); } protected function fetchDataForIndexView() { $tableProject = new Default_Model_Project(); $this->view->product = $tableProject->fetchProductInfo($this->_projectId); if (false === isset($this->view->product)) { throw new Zend_Controller_Action_Exception('This page does not exist', 404); } $desc = $this->view->product->description; $newDesc = $this->bbcode2html($desc); $this->view->product->description = $newDesc; // switch off temporally 02.05.2017 //$this->view->supporting = $tableProject->fetchProjectSupporterWithPlings($this->_projectId); //$orgUpdates = $tableProjectUpdates->fetchLastProjectUpdate($this->_projectId); $tableProjectUpdates = new Default_Model_ProjectUpdates(); $orgUpdates = $tableProjectUpdates->fetchProjectUpdates($this->_projectId); $newUpdates = array(); foreach ($orgUpdates as $update) { $desc = $update['text']; $newDesc = $this->bbcode2html($desc); $update['text'] = $newDesc; $newUpdates[] = $update; } $this->view->updates = $newUpdates; // switch off temporally 02.05.2017 //$this->view->supporter = $tableProject->fetchProjectSupporter($this->_projectId); $this->view->galleryPictures = $tableProject->getGalleryPictureSources($this->_projectId); $this->view->product_views = $tableProject->fetchProjectViews($this->_projectId); $helperFetchCategory = new Default_View_Helper_CatTitle(); $helperFetchCatParent = new Default_View_Helper_CatParent(); $this->view->catId = $this->view->product->project_category_id; $this->view->catTitle = $helperFetchCategory->catTitle($this->view->product->project_category_id); $this->view->catParentId = $helperFetchCatParent->getCatParentId(array('project_category_id' => $this->view->product->project_category_id)); if ($this->view->catParentId) { $this->view->catParentTitle = $helperFetchCategory->catTitle($this->view->catParentId); } $AuthCodeExist = new Local_Verification_WebsiteProject(); $this->view->websiteAuthCode = $AuthCodeExist->generateAuthCode(stripslashes($this->view->product->link_1)); // switch off temporally 02.05.2017 //$modelPlings = new Default_Model_DbTable_Plings(); //$this->view->plings = $modelPlings->getDonationsForProject($this->_projectId, 10); $tableMember = new Default_Model_Member(); $this->view->member = $tableMember->fetchMemberData($this->view->product->member_id); $this->view->more_products = $tableProject->fetchMoreProjects($this->view->product, 8); $this->view->more_products_otheruser = $tableProject->fetchMoreProjectsOfOtherUsr($this->view->product, 8); $widgetDefaultModel = new Default_Model_DbTable_ProjectWidgetDefault(); $widgetDefault = $widgetDefaultModel->fetchConfig($this->_projectId); $widgetDefault->text->headline = $this->view->product->title; //$widgetDefault->amounts->current = $this->view->product->amount_received; $widgetDefault->amounts->goal = $this->view->product->amount; $widgetDefault->project = $this->_projectId; $this->view->widgetConfig = $widgetDefault; $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl(); $this->view->permaLink = $helperBuildProductUrl->buildProductUrl($this->_projectId, null, null, true); $this->view->urlPay = $helperBuildProductUrl->buildProductUrl($this->_projectId, 'pay'); $referrerUrl = $this->readExploreUrlFromReferrer(); if (false === empty($referrerUrl)) { $this->view->referrerUrl = $referrerUrl; } } /** * transforms a string with bbcode markup into html * * @param string $txt * @param bool $nl2br * * @return string */ private function bbcode2html($txt, $nl2br = true, $forcecolor = '') { if (!empty($forcecolor)) { $fc = ' style="color:' . $forcecolor . ';"'; } else { $fc = ''; } $newtxt = htmlspecialchars($txt); if ($nl2br) { $newtxt = nl2br($newtxt); } $patterns = array( '`\[b\](.+?)\[/b\]`is', '`\[i\](.+?)\[/i\]`is', '`\[u\](.+?)\[/u\]`is', '`\[li\](.+?)\[/li\]`is', '`\[strike\](.+?)\[/strike\]`is', '`\[url\]([a-z0-9]+?://){1}([\w\-]+\.([\w\-]+\.)*[\w]+(:[0-9]+)?(/[^ \"\n\r\t<]*)?)\[/url\]`si', '`\[quote\](.+?)\[/quote\]`is', '`\[indent](.+?)\[/indent\]`is' ); $replaces = array( '\\1', '\\1', '\\1', '\\1', '\\1', '\1\2', 'Quote:
\1
', '\\1' ); $newtxt = preg_replace($patterns, $replaces, $newtxt); return ($newtxt); } protected function readExploreUrlFromReferrer() { $helperBuildExploreUrl = new Default_View_Helper_BuildExploreUrl(); $referrerExplore = $helperBuildExploreUrl->buildExploreUrl(null, null, null, null, true); /** @var Zend_Controller_Request_Http $request */ $request = $this->getRequest(); if (strpos($request->getHeader('referer'), $referrerExplore) !== false) { return $request->getHeader('referer'); } } public function plingAction() { if (empty($this->_projectId)) { $this->redirect('/explore'); } $this->view->authMember = $this->_authMember; $this->fetchDataForIndexView(); $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl(); $this->view->urlPay = $helperBuildProductUrl->buildProductUrl($this->_projectId, 'pay'); $this->view->amount = (float)$this->getParam('amount', 1); $this->view->comment = html_entity_decode(strip_tags($this->getParam('comment'), null), ENT_QUOTES, 'utf-8'); $this->view->provider = mb_strtolower(html_entity_decode(strip_tags($this->getParam('provider'), null), ENT_QUOTES, 'utf-8'), 'utf-8'); $this->view->headTitle($this->_browserTitlePrepend . $this->view->product->title, 'SET'); $helperUserIsOwner = new Default_View_Helper_UserIsOwner(); $helperIsProjectActive = new Default_View_Helper_IsProjectActive(); if ((false === $helperIsProjectActive->isProjectActive($this->view->product->project_status)) AND (false === $helperUserIsOwner->UserIsOwner($this->view->product->member_id)) ) { throw new Zend_Controller_Action_Exception('This page does not exist', 404); } $tableProject = new Default_Model_Project(); $this->view->supporting = $tableProject->fetchProjectSupporterWithPlings($this->_projectId); } public function payAction() { $this->_helper->layout()->disableLayout(); $tableProject = new Default_Model_Project(); $project = $tableProject->fetchProductInfo($this->_projectId); //get parameter $amount = (float)$this->getParam('amount', 1); $comment = Default_Model_HtmlPurify::purify($this->getParam('comment')); $paymentProvider = mb_strtolower(html_entity_decode(strip_tags($this->getParam('provider'), null), ENT_QUOTES, 'utf-8'), 'utf-8'); $hideIdentity = (int)$this->getParam('hideId', 0); $paymentGateway = $this->createPaymentGateway($paymentProvider); $paymentGateway->getUserDataStore()->generateFromArray($project->toArray()); $requestMessage = 'Thank you for supporting: ' . $paymentGateway->getUserDataStore()->getProductTitle(); $response = null; try { $response = $paymentGateway->requestPayment($amount, $requestMessage); $this->view->checkoutEndpoint = $paymentGateway->getCheckoutEndpoint(); $this->view->paymentKey = $response->getPaymentId(); $this->_helper->viewRenderer->setRender('pay_' . $paymentProvider); } catch (Exception $e) { throw new Zend_Controller_Action_Exception('payment error', 500, $e); } if (false === $response->isSuccessful()) { throw new Zend_Controller_Action_Exception('payment failure', 500); } if (empty($this->_authMember->member_id) or ($hideIdentity == 1)) { $memberId = 1; } else { $memberId = $this->_authMember->member_id; } //Add pling $modelPlings = new Default_Model_DbTable_Plings(); $plingId = $modelPlings->createNewPlingFromResponse($response, $memberId, $project->project_id, $amount); if (false == empty($comment)) { $modelComments = new Default_Model_ProjectComments(); $dataComment = array( 'comment_type' => Default_Model_DbTable_Comments::COMMENT_TYPE_PLING, 'comment_target_id' => $project->project_id, 'comment_member_id' => $memberId, 'comment_pling_id' => $plingId, 'comment_text' => $comment ); $modelComments->save($dataComment); } $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $memberId, Default_Model_ActivityLog::PROJECT_PLINGED, $project->toArray()); } /** * @param string $paymentProvider * * @return Local_Payment_GatewayInterface * @throws Exception * @throws Local_Payment_Exception * @throws Zend_Controller_Exception * @throws Zend_Exception */ protected function createPaymentGateway($paymentProvider) { $httpHost = $this->getRequest()->getHttpHost(); /** @var Zend_Config $config */ $config = Zend_Registry::get('config'); $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl(); switch ($paymentProvider) { case 'paypal': $paymentGateway = new Default_Model_PayPal_Gateway($config->third_party->paypal); $paymentGateway->setIpnNotificationUrl('http://' . $httpHost . '/gateway/paypal'); // $paymentGateway->setIpnNotificationUrl('http://' . $httpHost . '/gateway/paypal?XDEBUG_SESSION_START=1'); $paymentGateway->setCancelUrl($helperBuildProductUrl->buildProductUrl($this->_projectId, 'paymentcancel', null, true)); $paymentGateway->setReturnUrl($helperBuildProductUrl->buildProductUrl($this->_projectId, 'paymentok', null, true)); break; case 'dwolla': $paymentGateway = new Default_Model_Dwolla_Gateway($config->third_party->dwolla); $paymentGateway->setIpnNotificationUrl('http://' . $httpHost . '/gateway/dwolla'); // $paymentGateway->setIpnNotificationUrl('http://' . $_SERVER ['HTTP_HOST'] . '/gateway/dwolla?XDEBUG_SESSION_START=1'); $paymentGateway->setReturnUrl($helperBuildProductUrl->buildProductUrl($this->_projectId, 'dwolla', null, true)); break; case 'amazon': $paymentGateway = new Default_Model_Amazon_Gateway($config->third_party->amazon); $paymentGateway->setIpnNotificationUrl('http://' . $httpHost . '/gateway/amazon'); // $paymentGateway->setIpnNotificationUrl('http://' . $httpHost . '/gateway/amazon?XDEBUG_SESSION_START=1'); $paymentGateway->setCancelUrl($helperBuildProductUrl->buildProductUrl($this->_projectId, 'paymentcancel', null, true)); $paymentGateway->setReturnUrl($helperBuildProductUrl->buildProductUrl($this->_projectId, 'paymentok', null, true)); break; default: throw new Zend_Controller_Exception('No known payment provider found in parameters.'); break; } return $paymentGateway; } public function dwollaAction() { $modelPling = new Default_Model_DbTable_Plings(); $plingData = $modelPling->fetchRow(array('payment_reference_key = ?' => $this->getParam('checkoutId'))); $plingData->payment_transaction_id = (int)$this->getParam('transaction'); $plingData->save(); if ($this->_getParam('status') == 'Completed') { $this->_helper->viewRenderer('paymentok'); $this->paymentokAction(); } else { $this->_helper->viewRenderer('paymentcancel'); $this->paymentcancelAction(); } } public function paymentokAction() { $this->_helper->layout()->disableLayout(); $this->view->paymentStatus = 'success'; $this->view->paymentMessage = 'Payment successful.'; $this->fetchDataForIndexView(); } public function paymentcancelAction() { $this->_helper->layout()->disableLayout(); $this->view->paymentStatus = 'danger'; $this->view->paymentMessage = 'Payment cancelled.'; $this->fetchDataForIndexView(); } public function deleteAction() { $this->_helper->layout()->setLayout('flat_ui'); $memberId = (int)$this->getParam('m'); if ((empty($this->_authMember->member_id)) OR (empty($memberId)) OR ($this->_authMember->member_id != $memberId) ) { $this->forward('products', 'user', 'default'); return; } $tableProduct = new Default_Model_Project(); $tableProduct->setDeleted($this->_authMember->member_id,$this->_projectId); $product = $tableProduct->find($this->_projectId)->current(); // delete product from search index $modelSearch = new Default_Model_Search_Lucene(); $modelSearch->deleteDocument($product->toArray()); // $command = new Backend_Commands_DeleteProductExtended($product); // $command->doCommand(); // $queue = Local_Queue_Factory::getQueue('search'); // $command = new Backend_Commands_DeleteProductFromIndex($product->project_id, $product->project_category_id); // $msg = $queue->send(serialize($command)); // ppload // Delete collection if ($product->ppload_collection_id) { $pploadApi = new Ppload_Api(array( 'apiUri' => PPLOAD_API_URI, 'clientId' => PPLOAD_CLIENT_ID, 'secret' => PPLOAD_SECRET )); $collectionResponse = $pploadApi->deleteCollection($product->ppload_collection_id); } $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_DELETED, $product->toArray()); $this->forward('products', 'user', 'default'); } public function unpublishAction() { $this->_helper->layout()->setLayout('flat_ui'); $memberId = (int)$this->getParam('m'); if ( (empty($this->_authMember->member_id)) OR (empty($memberId)) OR ($this->_authMember->member_id != $memberId) ) { return; } $tableProduct = new Default_Model_Project(); $tableProduct->setInActive($this->_projectId, $memberId); $product = $tableProduct->find($this->_projectId)->current(); if (isset($product->type_id) && $product->type_id == Default_Model_Project::PROJECT_TYPE_UPDATE) { $parentProduct = $tableProduct->find($product->pid)->current(); $product->image_small = $parentProduct->image_small; } $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_UNPUBLISHED, $product->toArray()); // remove unpublished project from search index $modelSearch = new Default_Model_Search_Lucene(); $modelSearch->deleteDocument($product); // ppload if ($product->ppload_collection_id) { $pploadApi = new Ppload_Api(array( 'apiUri' => PPLOAD_API_URI, 'clientId' => PPLOAD_CLIENT_ID, 'secret' => PPLOAD_SECRET )); // Update collection information $collectionRequest = array( 'category' => $product->project_category_id ); $collectionResponse = $pploadApi->putCollection($product->ppload_collection_id, $collectionRequest); } $this->forward('products', 'user', 'default', array('member_id' => $memberId)); //$this->redirect('/member/'.$memberId.'/products'); } public function publishAction() { $memberId = (int)$this->getParam('m'); if ((empty($this->_authMember->member_id)) OR (empty($memberId)) OR ($this->_authMember->member_id != $memberId) ) { return; } $tableProduct = new Default_Model_Project(); $tableProduct->setActive($this->_authMember->member_id,$this->_projectId); $product = $tableProduct->find($this->_projectId)->current(); if (isset($product->type_id) && $product->type_id == Default_Model_Project::PROJECT_TYPE_UPDATE) { $parentProduct = $tableProduct->find($product->pid)->current(); $product->image_small = $parentProduct->image_small; } $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_PUBLISHED, $product->toArray()); // add published project to search index // $productInfo = $tableProduct->fetchProductInfo($this->_projectId); // $modelSearch = new Default_Model_Search_Lucene(); // $modelSearch->addDocument($productInfo); // ppload if ($product->ppload_collection_id) { $pploadApi = new Ppload_Api(array( 'apiUri' => PPLOAD_API_URI, 'clientId' => PPLOAD_CLIENT_ID, 'secret' => PPLOAD_SECRET )); // Update collection information $collectionRequest = array( 'category' => $product->project_category_id . '-published' ); $collectionResponse = $pploadApi->putCollection($product->ppload_collection_id, $collectionRequest); } $this->forward('products', 'user', 'default', array('member_id' => $memberId)); //$this->redirect('/member/'.$memberId.'/products'); } public function loadratingsAction() { $this->_helper->layout->disableLayout(); $tableProjectRatings = new Default_Model_DbTable_ProjectRating(); $ratings = $tableProjectRatings->fetchRating($this->_projectId); $this->_helper->json($ratings); } + + public function loadtagratingAction() + { + $this->_helper->layout->disableLayout(); + //$tableProjectRatings = new Default_Model_DbTable_ProjectRating(); + //$ratings = $tableProjectRatings->fetchTagRating($this->_projectId); + $category_id= $this->getParam('gid'); + $model = new Default_Model_ProjectTagRatings(); + $ratingsLabel = $model->getCategoryTagRatings($category_id); + $ratingsValue=null; + if($ratingsLabel!=null && sizeof($ratingsLabel)>0) + { + $ratingsValue = $model->getProjectTagRatings($this->_projectId); + } + + $this->_helper->json(array( + 'status' => 'ok', + 'labels' =>$ratingsLabel, + 'values' =>$ratingsValue + )); + } + public function votetagratingAction() + { + $this->_helper->layout->disableLayout(); + $vote= $this->getParam('vote'); + $tag_id= $this->getParam('tid'); + $model = new Default_Model_ProjectTagRatings(); + if($this->_authMember->member_id) + { + $checkVote = $model->checkIfVote($this->_authMember->member_id,$this->_projectId,$tag_id); + if(!$checkVote) + { + $model->doVote($this->_authMember->member_id,$this->_projectId,$tag_id,$vote); + }else{ + if($checkVote['vote']== $vote) + { + $model->removeVote($checkVote['tag_rating_id']); + }else{ + $model->removeVote($checkVote['tag_rating_id']); + $model->doVote($this->_authMember->member_id,$this->_projectId,$tag_id,$vote); + } + } + + $this->_helper->json(array( + 'status' => 'ok' + )); + }else{ + $this->_helper->json(array( + 'status' => 'error', + 'msg' =>'Login please' + )); + } + } public function loadfilesjsonAction() { $this->_helper->layout->disableLayout(); // $project_id = $this->getParam('pid'); $modelProject = new Default_Model_Project(); $files = $modelProject->fetchFilesForProject($this->_projectId); $salt = PPLOAD_DOWNLOAD_SECRET; foreach ($files as &$file) { $timestamp = time() + 3600; // one hour valid $hash = hash('sha512',$salt . $file['collection_id'] . $timestamp); // order isn't important at all... just do the same when verifying $url = PPLOAD_API_URI . 'files/download/id/' . $file['id'] . '/s/' . $hash . '/t/' . $timestamp; if(null != $this->_authMember) { $url .= '/u/' . $this->_authMember->member_id; } $url .= '/lt/filepreview/' . $file['name']; $file['url'] = urlencode($url); } $this->_helper->json($files); } public function loadfirstfilejsonAction() { $this->_helper->layout->disableLayout(); // $project_id = $this->getParam('pid'); $modelProject = new Default_Model_Project(); $files = $modelProject->fetchFilesForProject($this->_projectId); $salt = PPLOAD_DOWNLOAD_SECRET; $file = $files[0]; $timestamp = time() + 3600; // one hour valid $hash = hash('sha512',$salt . $file['collection_id'] . $timestamp); // order isn't important at all... just do the same when verifying $url = PPLOAD_API_URI . 'files/download/id/' . $file['id'] . '/s/' . $hash . '/t/' . $timestamp; if(null != $this->_authMember) { $url .= '/u/' . $this->_authMember->member_id; } $url .= '/lt/filepreview/' . $file['name']; $file['url'] = urlencode($url); $this->_helper->json($file); } public function loadinstallinstructionAction() { $this->_helper->layout->disableLayout(); $infomodel = new Default_Model_Info(); $text = $infomodel->getOCSInstallInstruction(); $this->_helper->json(array( 'status' => 'ok', 'data' => $text )); } public function followAction() { $this->_helper->layout()->disableLayout(); // $this->_helper->viewRenderer->setNoRender(true); $this->view->project_id = $this->_projectId; $this->view->authMember = $this->_authMember; if (array_key_exists($this->_projectId, $this->_authMember->projects)) { return; } $projectFollowTable = new Default_Model_DbTable_ProjectFollower(); $newVals = array('project_id' => $this->_projectId, 'member_id' => $this->_authMember->member_id); $where = $projectFollowTable->select()->where('member_id = ?', $this->_authMember->member_id) ->where('project_id = ?', $this->_projectId, 'INTEGER') ; $result = $projectFollowTable->fetchRow($where); if (null === $result) { $projectFollowTable->createRow($newVals)->save(); $tableProduct = new Default_Model_Project(); $product = $tableProduct->find($this->_projectId)->current(); $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_FOLLOWED, $product->toArray()); } // ppload //Add collection to favorite // $projectTable = new Default_Model_DbTable_Project(); // $projectData = $projectTable->find($this->_projectId)->current(); // if ($projectData->ppload_collection_id) { // $pploadApi = new Ppload_Api(array( // 'apiUri' => PPLOAD_API_URI, // 'clientId' => PPLOAD_CLIENT_ID, // 'secret' => PPLOAD_SECRET // )); // // $favoriteRequest = array( // 'user_id' => $this->_authMember->member_id, // 'collection_id' => $projectData->ppload_collection_id // ); // // $favoriteResponse = $pploadApi->postFavorite($favoriteRequest); // } } public function unfollowAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer('follow'); $this->view->project_id = $this->_projectId; $this->view->authMember = $this->_authMember; $projectFollowTable = new Default_Model_DbTable_ProjectFollower(); $projectFollowTable->delete('member_id=' . $this->_authMember->member_id . ' AND project_id=' . $this->_projectId); $tableProduct = new Default_Model_Project(); $product = $tableProduct->find($this->_projectId)->current(); $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_UNFOLLOWED, $product->toArray()); // ppload // Delete collection from favorite // $projectTable = new Default_Model_DbTable_Project(); // $projectData = $projectTable->find($this->_projectId)->current(); // if ($projectData->ppload_collection_id) { // $pploadApi = new Ppload_Api(array( // 'apiUri' => PPLOAD_API_URI, // 'clientId' => PPLOAD_CLIENT_ID, // 'secret' => PPLOAD_SECRET // )); // // $favoriteRequest = array( // 'user_id' => $this->_authMember->member_id, // 'collection_id' => $projectData->ppload_collection_id // ); // // $favoriteResponse = // $pploadApi->postFavorite($favoriteRequest); // This post call will retrieve existing favorite info // if (!empty($favoriteResponse->favorite->id)) { // $favoriteResponse = $pploadApi->deleteFavorite($favoriteResponse->favorite->id); // } // } } public function followpAction() { $this->_helper->layout()->disableLayout(); // $this->_helper->viewRenderer->setNoRender(true); $this->view->project_id = $this->_projectId; $this->view->authMember = $this->_authMember; if (array_key_exists($this->_projectId, $this->_authMember->projects)) { return; } $projectFollowTable = new Default_Model_DbTable_ProjectFollower(); $newVals = array('project_id' => $this->_projectId, 'member_id' => $this->_authMember->member_id); $where = $projectFollowTable->select()->where('member_id = ?', $this->_authMember->member_id) ->where('project_id = ?', $this->_projectId, 'INTEGER') ; $result = $projectFollowTable->fetchRow($where); if (null === $result) { $projectFollowTable->createRow($newVals)->save(); $tableProduct = new Default_Model_Project(); $product = $tableProduct->find($this->_projectId)->current(); $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_FOLLOWED, $product->toArray()); } } public function unfollowpAction() { $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer('followp'); $this->view->project_id = $this->_projectId; $this->view->authMember = $this->_authMember; $projectFollowTable = new Default_Model_DbTable_ProjectFollower(); $projectFollowTable->delete('member_id=' . $this->_authMember->member_id . ' AND project_id=' . $this->_projectId); $tableProduct = new Default_Model_Project(); $product = $tableProduct->find($this->_projectId)->current(); $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_UNFOLLOWED, $product->toArray()); } protected function logActivity($logId) { $tableProduct = new Default_Model_Project(); $product = $tableProduct->find($this->_projectId)->current(); $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, $logId, $product->toArray()); } public function followprojectAction() { $this->_helper->layout()->disableLayout(); $this->view->project_id = $this->_projectId; $this->view->authMember = $this->_authMember; // not allow to pling himself if (array_key_exists($this->_projectId, $this->_authMember->projects)) { $this->_helper->json(array( 'status' => 'error', 'msg' => 'not allowed' )); return; } $projectFollowTable = new Default_Model_DbTable_ProjectFollower(); $newVals = array('project_id' => $this->_projectId, 'member_id' => $this->_authMember->member_id); $where = $projectFollowTable->select()->where('member_id = ?', $this->_authMember->member_id) ->where('project_id = ?', $this->_projectId, 'INTEGER') ; $result = $projectFollowTable->fetchRow($where); if (null === $result) { $projectFollowTable->createRow($newVals)->save(); $this->logActivity(Default_Model_ActivityLog::PROJECT_FOLLOWED); $cnt = $projectFollowTable->countForProject($this->_projectId); $this->_helper->json(array( 'status' => 'ok', 'msg' => 'Success.', 'cnt' => $cnt, 'action' =>'insert' )); }else{ $projectFollowTable->delete('member_id=' . $this->_authMember->member_id . ' AND project_id=' . $this->_projectId); $this->logActivity(Default_Model_ActivityLog::PROJECT_UNFOLLOWED); $cnt = $projectFollowTable->countForProject($this->_projectId); $this->_helper->json(array( 'status' => 'ok', 'msg' => 'Success.', 'cnt' => $cnt, 'action' => 'delete' )); } } public function plingprojectAction() { $this->_helper->layout()->disableLayout(); $this->view->project_id = $this->_projectId; $this->view->authMember = $this->_authMember; // not allow to pling himself if (array_key_exists($this->_projectId, $this->_authMember->projects)) { $this->_helper->json(array( 'status' => 'error', 'msg' => 'not allowed' )); return; } // not allow to pling if not supporter $helperIsSupporter = new Default_View_Helper_IsSupporter(); if(!$helperIsSupporter->isSupporter($this->_authMember->member_id)) { $this->_helper->json(array( 'status' => 'error', 'msg' => 'become a supporter first please. ' )); return; } $projectplings = new Default_Model_ProjectPlings(); $newVals = array('project_id' => $this->_projectId, 'member_id' => $this->_authMember->member_id); $sql = $projectplings->select() ->where('member_id = ?', $this->_authMember->member_id) ->where('is_deleted = ?',0) ->where('project_id = ?', $this->_projectId, 'INTEGER') ; $result = $projectplings->fetchRow($sql); if (null === $result) { $projectplings->createRow($newVals)->save(); //$this->logActivity(Default_Model_ActivityLog::PROJECT_PLINGED_2); $cnt = $projectplings->getPlingsAmount($this->_projectId); $this->_helper->json(array( 'status' => 'ok', 'msg' => 'Success.', 'cnt' => $cnt, 'action' =>'insert' )); }else{ // delete pling $projectplings->setDelete($result->project_plings_id); //$this->logActivity(Default_Model_ActivityLog::PROJECT_DISPLINGED_2); $cnt = $projectplings->getPlingsAmount($this->_projectId); $this->_helper->json(array( 'status' => 'ok', 'msg' => 'Success.', 'cnt' => $cnt, 'action' => 'delete' )); } } /** public function unplingprojectAction() { $this->_helper->layout()->disableLayout(); $projectplings = new Default_Model_ProjectPlings(); $pling = $projectplings->getPling($this->_projectId,$this->_authMember->member_id); if($pling) { $projectplings->setDelete($pling->project_plings_id); $cnt = count($projectplings->getPlings($this->_projectId)); $this->_helper->json(array( 'status' => 'ok', 'deleted' => $pling->project_plings_id, 'msg' => 'Success. ', 'cnt' => $cnt )); $tableProduct = new Default_Model_Project(); $product = $tableProduct->find($this->_projectId)->current(); $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $this->_authMember->member_id, Default_Model_ActivityLog::PROJECT_DISPLINGED_2, $product->toArray()); }else{ $this->_helper->json(array( 'status' => 'error', 'msg' => 'not existing.' )); } } **/ public function followsAction() { $projectFollowTable = new Default_Model_Member(); $memberId = $this->_authMember->member_id; $this->view->productList = $projectFollowTable->fetchFollowedProjects($memberId); $projectArray = $this->generateFollowedProjectsViewData($this->view->productList); $this->view->productArray['followedProjects'] = $projectArray; } /** * @param $list * * @return array */ protected function generateFollowedProjectsViewData($list) { $viewArray = array(); if (count($list) == 0) { return $viewArray; } $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl(); foreach ($list as $element) { $arr = array(); $arr['id'] = $element->project_id; $arr['name'] = $element->title; $arr['image'] = $element->image_small; $arr['url'] = $helperBuildProductUrl->buildProductUrl($element->project_id); $arr['urlUnFollow'] = $helperBuildProductUrl->buildProductUrl($element->project_id, 'unfollow'); #$arr['showUrlUnFollow'] = $this->view->isMember; $viewArray[] = $arr; } return $viewArray; } public function verifycodeAction() { $this->_helper->layout()->disableLayout(); if ($this->_request->isXmlHttpRequest()) { $tabProject = new Default_Model_DbTable_Project(); $dataProject = $tabProject->find($this->_projectId)->current(); $this->createTaskWebsiteOwnerVerification($dataProject); $this->view->message = 'Your product page is stored for validation.'; return; } $this->view->message = 'This service is not available at the moment. Please try again later.'; } /** * @throws Zend_Controller_Action_Exception * @deprecated */ public function fetchAction() { $this->_helper->layout()->disableLayout(); if ($this->_request->isXmlHttpRequest()) { $this->view->authMember = $this->_authMember; $this->fetchDataForIndexView(); $tableProject = new Default_Model_Project(); $this->view->supporting = $tableProject->fetchProjectSupporterWithPlings($this->_projectId); if (false === isset($this->view->product)) { throw new Zend_Controller_Action_Exception('This page does not exist', 404); } $helperUserIsOwner = new Default_View_Helper_UserIsOwner(); $helperIsProjectActive = new Default_View_Helper_IsProjectActive(); if ((false === $helperIsProjectActive->isProjectActive($this->view->product->project_status)) AND (false === $helperUserIsOwner->UserIsOwner($this->view->product->member_id)) ) { throw new Zend_Controller_Action_Exception('This page does not exist', 404); } $tablePageViews = new Default_Model_DbTable_StatPageViews(); $tablePageViews->savePageView($this->_projectId, $this->getRequest()->getClientIp(), $this->_authMember->member_id); } $this->_helper->json(get_object_vars($this->view)); } public function claimAction() { $modelProduct = new Default_Model_Project(); $productInfo = $modelProduct->fetchProductInfo($this->_projectId); if ($productInfo->claimable != Default_Model_Project::PROJECT_CLAIMABLE) { throw new Zend_Controller_Action_Exception('Method not available', 404); } $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl(); if (empty($productInfo->claimed_by_member)) { $modelProduct->setClaimedByMember($this->_authMember->member_id, $this->_projectId); $claimMail = new Default_Plugin_SendMail('tpl_mail_claim_product'); $claimMail->setTemplateVar('sender', $this->_authMember->mail); $claimMail->setTemplateVar('productid', $productInfo->project_id); $claimMail->setTemplateVar('producttitle', $productInfo->title); $claimMail->setTemplateVar('userid', $this->_authMember->member_id); $claimMail->setTemplateVar('username', $this->_authMember->username); $claimMail->setTemplateVar('usermail', $this->_authMember->mail); $claimMail->setReceiverMail(array('contact@opendesktop.org')); $claimMail->send(); $claimMailConfirm = new Default_Plugin_SendMail('tpl_mail_claim_confirm'); $claimMailConfirm->setTemplateVar('sender', 'contact@opendesktop.org'); $claimMailConfirm->setTemplateVar('producttitle', $productInfo->title); $claimMailConfirm->setTemplateVar('productlink', 'http://' . $this->getRequest()->getHttpHost() . $helperBuildProductUrl->buildProductUrl($productInfo->project_id)); $claimMailConfirm->setTemplateVar('username', $this->_authMember->username); $claimMailConfirm->setReceiverMail($this->_authMember->mail); $claimMailConfirm->send(); } $this->_helper->viewRenderer('index'); $this->indexAction(); } public function makerconfigAction() { $this->_helper->layout()->disableLayout(); $widgetProjectId = (int)$this->getParam('project_id'); if (false == isset($widgetProjectId)) { throw new Zend_Controller_Action_Exception('This page does not exist', 404); } $widgetDefaultModel = new Default_Model_DbTable_ProjectWidgetDefault(); $widgetDefault = $widgetDefaultModel->fetchConfig($widgetProjectId); if (!isset($widgetDefault)) { throw new Zend_Controller_Action_Exception('This page does not exist', 404); } else { $this->view->widgetConfig = $widgetDefault; $productModel = new Default_Model_Project(); $this->view->product = $productModel->fetchProductDataFromMV($widgetProjectId); $this->view->supporting = $productModel->fetchProjectSupporterWithPlings($widgetProjectId); $plingModel = new Default_Model_DbTable_Plings(); $this->view->comments = $plingModel->getCommentsForProject($widgetProjectId, 10); $websiteOwner = new Local_Verification_WebsiteProject(); $this->view->authCode = ''; } } /** * ppload */ public function addpploadfileAction() { $this->_helper->layout()->disableLayout(); $log = Zend_Registry::get('logger'); $log->debug('**********' . __CLASS__ . '::' . __FUNCTION__ . '**********' . "\n"); $projectTable = new Default_Model_DbTable_Project(); $projectData = $projectTable->find($this->_projectId)->current(); $error_text = ''; // Add file to ppload collection if (!empty($_FILES['file_upload']['tmp_name']) && $_FILES['file_upload']['error'] == UPLOAD_ERR_OK ) { $tmpFilename = dirname($_FILES['file_upload']['tmp_name']) . '/' . basename($_FILES['file_upload']['name']); $log->debug(__CLASS__ . '::' . __FUNCTION__ . '::' . print_r($tmpFilename, true) . "\n"); move_uploaded_file($_FILES['file_upload']['tmp_name'], $tmpFilename); $pploadApi = new Ppload_Api(array( 'apiUri' => PPLOAD_API_URI, 'clientId' => PPLOAD_CLIENT_ID, 'secret' => PPLOAD_SECRET )); $fileRequest = array( 'file' => $tmpFilename, 'owner_id' => $this->_authMember->member_id ); //Admins can upload files for users $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { $member_id = $projectData->member_id; $fileRequest = array( 'file' => $tmpFilename, 'owner_id' => $member_id ); } if ($projectData->ppload_collection_id) { // Append to existing collection $fileRequest['collection_id'] = $projectData->ppload_collection_id; } //if (isset($_POST['file_description'])) { // $fileRequest['description'] = mb_substr($_POST['file_description'], 0, 140); //} $fileResponse = $pploadApi->postFile($fileRequest); $log->debug(__CLASS__ . '::' . __FUNCTION__ . '::' . print_r($fileResponse, true) . "\n"); unlink($tmpFilename); if (!empty($fileResponse->file->collection_id)) { if (!$projectData->ppload_collection_id) { // Save collection ID $projectData->ppload_collection_id = $fileResponse->file->collection_id; //20180219 ronald: we set the changed_at only by new files or new updates if((int)$this->_authMember->member_id==(int)$projectData->member_id) { $projectData->changed_at = new Zend_Db_Expr('NOW()'); } else { $log->info('********** ' . __CLASS__ . '::' . __FUNCTION__ . ' Project ChangedAt is not set: Auth-Member ('.$this->_authMember->member_id.') != Project-Owner ('.$projectData->member_id.'): **********' . "\n"); } $projectData->ghns_excluded = 0; $projectData->save(); $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog($this->_projectId, $projectData->member_id, Default_Model_ActivityLog::PROJECT_EDITED, $projectData->toArray()); // Update profile information $memberTable = new Default_Model_DbTable_Member(); $memberSettings = $memberTable->find($this->_authMember->member_id)->current(); $mainproject = $projectTable->find($memberSettings->main_project_id)->current(); $profileName = ''; if ($memberSettings->firstname || $memberSettings->lastname ) { $profileName = trim($memberSettings->firstname . ' ' . $memberSettings->lastname); } else { if ($memberSettings->username) { $profileName = $memberSettings->username; } } $profileRequest = array( 'owner_id' => $this->_authMember->member_id, 'name' => $profileName, 'email' => $memberSettings->mail, 'homepage' => $memberSettings->link_website, 'description' => $mainproject->description ); $profileResponse = $pploadApi->postProfile($profileRequest); // Update collection information $collectionCategory = $projectData->project_category_id; if (Default_Model_Project::PROJECT_ACTIVE == $projectData->status) { $collectionCategory .= '-published'; } $collectionRequest = array( 'title' => $projectData->title, 'description' => $projectData->description, 'category' => $collectionCategory, 'content_id' => $projectData->project_id ); $collectionResponse = $pploadApi->putCollection($projectData->ppload_collection_id, $collectionRequest); // Store product image as collection thumbnail $this->_updatePploadMediaCollectionthumbnail($projectData); } else { //20180219 ronald: we set the changed_at only by new files or new updates if((int)$this->_authMember->member_id==(int)$projectData->member_id) { $projectData->changed_at = new Zend_Db_Expr('NOW()'); } else { $log->info('********** ' . __CLASS__ . '::' . __FUNCTION__ . ' Project ChangedAt is not set: Auth-Member ('.$this->_authMember->member_id.') != Project-Owner ('.$projectData->member_id.'): **********' . "\n"); } $projectData->ghns_excluded = 0; $projectData->save(); } //If this file is a video, we have to convert it for preview if(!empty($fileResponse->file->type) && in_array($fileResponse->file->type, Backend_Commands_ConvertVideo::$VIDEO_FILE_TYPES)) { $queue = Local_Queue_Factory::getQueue(); $command = new Backend_Commands_ConvertVideo($projectData->ppload_collection_id, $fileResponse->file->id, $fileResponse->file->type); $queue->send(serialize($command)); } //If this file is bigger than XXX MB (see application.ini), then create a webtorrent file $config = Zend_Registry::get('config'); $minFileSize = $config->torrent->media->min_filesize; if(!empty($fileResponse->file->size) && $fileResponse->file->size >= $minFileSize) { $queue = Local_Queue_Factory::getQueue(); $command = new Backend_Commands_CreateTorrent($fileResponse->file); $queue->send(serialize($command)); } //If this is a cbr or cbz comic archive, then start an extracting job if($this->endsWith($fileResponse->file->name, '.cbr') || $this->endsWith($fileResponse->file->name, '.cbz')) { $queue = Local_Queue_Factory::getQueue(); $command = new Backend_Commands_ExtractComic($fileResponse->file); $queue->send(serialize($command)); } $this->_helper->json(array( 'status' => 'ok', 'file' => $fileResponse->file )); return; } } $log->debug('********** END ' . __CLASS__ . '::' . __FUNCTION__ . '**********' . "\n"); $this->_helper->json(array('status' => 'error', 'error_text' => $error_text)); } private function endsWith($haystack, $needle) { return $needle === "" || substr(strtolower($haystack), -strlen($needle)) === strtolower($needle); } /** * ppload */ public function updatepploadfileAction() { $this->_helper->layout()->disableLayout(); $log = Zend_Registry::get('logger'); $log->debug('**********' . __CLASS__ . '::' . __FUNCTION__ . '**********' . "\n"); $projectTable = new Default_Model_DbTable_Project(); $projectData = $projectTable->find($this->_projectId)->current(); $error_text = ''; // Update a file in ppload collection if (!empty($_POST['file_id'])) { $pploadApi = new Ppload_Api(array( 'apiUri' => PPLOAD_API_URI, 'clientId' => PPLOAD_CLIENT_ID, 'secret' => PPLOAD_SECRET )); $fileResponse = $pploadApi->getFile($_POST['file_id']); if (isset($fileResponse->file->collection_id) && $fileResponse->file->collection_id == $projectData->ppload_collection_id ) { $fileRequest = array(); $tmpFilename = ''; if (!empty($_FILES['file_upload']['tmp_name']) && $_FILES['file_upload']['error'] == UPLOAD_ERR_OK ) { $tmpFilename = dirname($_FILES['file_upload']['tmp_name']) . '/' . basename($_FILES['file_upload']['name']); $log->debug(__CLASS__ . '::' . __FUNCTION__ . '::' . print_r($tmpFilename, true) . "\n"); move_uploaded_file($_FILES['file_upload']['tmp_name'], $tmpFilename); $fileRequest['file'] = $tmpFilename; //20180219 ronald: we set the changed_at only by new files or new updates if((int)$this->_authMember->member_id==(int)$projectData->member_id) { $projectData->changed_at = new Zend_Db_Expr('NOW()'); } else { $log->info('********** ' . __CLASS__ . '::' . __FUNCTION__ . ' Project ChangedAt is not set: Auth-Member ('.$this->_authMember->member_id.') != Project-Owner ('.$projectData->member_id.'): **********' . "\n"); } $projectData->ghns_excluded = 0; $projectData->save(); } if (isset($_POST['file_description'])) { $fileRequest['description'] = mb_substr($_POST['file_description'], 0, 140); } if (isset($_POST['file_category'])) { $fileRequest['category'] = $_POST['file_category']; } if (isset($_POST['file_tags'])) { $fileRequest['tags'] = $_POST['file_tags']; } if (isset($_POST['ocs_compatible'])) { $fileRequest['ocs_compatible'] = $_POST['ocs_compatible']; } if (isset($_POST['file_version'])) { $fileRequest['version'] = $_POST['file_version']; } $fileResponse = $pploadApi->putFile($_POST['file_id'], $fileRequest); $log->debug(__CLASS__ . '::' . __FUNCTION__ . '::' . print_r($fileResponse, true) . "\n"); if ($tmpFilename) { unlink($tmpFilename); } if (isset($fileResponse->status) && $fileResponse->status == 'success' ) { //If this file is bigger than XXX MB (see application.ini), then create a webtorrent file $config = Zend_Registry::get('config'); $minFileSize = $config->torrent->media->min_filesize; if(!empty($fileResponse->file->size) && $fileResponse->file->size >= $minFileSize) { $queue = Local_Queue_Factory::getQueue(); $command = new Backend_Commands_CreateTorrent($fileResponse->file); $queue->send(serialize($command)); } $this->_helper->json(array( 'status' => 'ok', 'file' => $fileResponse->file )); return; } else { $error_text .= 'Response: $pploadApi->putFile(): ' . json_encode($fileResponse) . '; $fileResponse->status: ' . $fileResponse->status; } } else { $error_text .= 'PPload Response: ' . json_encode($fileResponse) . '; fileResponse->file->collection_id: ' . $fileResponse->file->collection_id . ' != $projectData->ppload_collection_id: ' . $projectData->ppload_collection_id; } } else { $error_text .= 'No CollectionId or no FileId. CollectionId: ' . $projectData->ppload_collection_id . ', FileId: ' . $_POST['file_id']; } $log->debug('********** END ' . __CLASS__ . '::' . __FUNCTION__ . '**********' . "\n"); $this->_helper->json(array('status' => 'error', 'error_text' => $error_text)); } public function updatefiletagAction() { $this->_helper->layout()->disableLayout(); $error_text = ''; // Update a file information in ppload collection if (!empty($_POST['file_id'])) { $tagId = null; if (isset($_POST['tag_id'])) { $tagId = $_POST['tag_id']; } $tagGroupId = null; if (isset($_POST['tag_group_id'])) { $tagGroupId = $_POST['tag_group_id']; } //set architecture $modelTags = new Default_Model_Tags(); $modelTags->saveFileTagForProjectAndTagGroup($this->_projectId, $_POST['file_id'], $tagId, $tagGroupId); $this->_helper->json(array('status' => 'ok')); return; } else { $error_text .= 'No FileId. , FileId: ' . $_POST['file_id']; } $this->_helper->json(array('status' => 'error', 'error_text' => $error_text)); } public function deletefiletagAction() { $this->_helper->layout()->disableLayout(); $error_text = ''; // Update a file information in ppload collection if (!empty($_POST['file_id'])) { $tagId = null; if (isset($_POST['tag_id'])) { $tagId = $_POST['tag_id']; } //set architecture $modelTags = new Default_Model_Tags(); $modelTags->deleteFileTagForProject($this->_projectId, $_POST['file_id'], $tagId); $this->_helper->json(array('status' => 'ok')); return; } else { $error_text .= 'No FileId. , FileId: ' . $_POST['file_id']; } $this->_helper->json(array('status' => 'error', 'error_text' => $error_text)); } public function updatecompatibleAction() { $this->_helper->layout()->disableLayout(); $error_text = ''; // Update a file information in ppload collection if (!empty($_POST['file_id'])) { $typeId = null; if (isset($_POST['is_compatible'])) { $is_compatible = $_POST['is_compatible']; } return; } else { $error_text .= 'No FileId. , FileId: ' . $_POST['file_id']; } $this->_helper->json(array('status' => 'error', 'error_text' => $error_text)); } public function startdownloadAction() { $this->_helper->layout()->disableLayout(); /** * Save Download-Data in Member_Download_History */ $file_id = $this->getParam('file_id'); $file_type = $this->getParam('file_type'); $file_name = $this->getParam('file_name'); $file_size = $this->getParam('file_size'); $projectId = $this->_projectId; $this->redirect('/dl?file_id='.$file_id.'&file_type='.$file_type.'&file_name='.$file_name.'&file_size='.$file_size.'&project_id='.$projectId); // if ($_SERVER['REQUEST_METHOD'] == 'POST') { /* if(isset($file_id) && isset($projectId) && isset($memberId)) { $memberDlHistory = new Default_Model_DbTable_MemberDownloadHistory(); $data = array('project_id' => $projectId, 'member_id' => $memberId, 'file_id' => $file_id, 'file_type' => $file_type, 'file_name' => $file_name, 'file_size' => $file_size); $memberDlHistory->createRow($data)->save(); } $url = urldecode($urltring); $this->redirect($url); * */ // } else { // $this->redirect('/ads?file_id='.$file_id); // } } /** * ppload */ public function deletepploadfileAction() { $this->_helper->layout()->disableLayout(); $projectTable = new Default_Model_DbTable_Project(); $projectData = $projectTable->find($this->_projectId)->current(); $error_text = ''; // Delete file from ppload collection if (!empty($_POST['file_id'])) { $pploadApi = new Ppload_Api(array( 'apiUri' => PPLOAD_API_URI, 'clientId' => PPLOAD_CLIENT_ID, 'secret' => PPLOAD_SECRET )); $fileResponse = $pploadApi->getFile($_POST['file_id']); if (isset($fileResponse->file->collection_id) && $fileResponse->file->collection_id == $projectData->ppload_collection_id ) { $fileResponse = $pploadApi->deleteFile($_POST['file_id']); if (isset($fileResponse->status) && $fileResponse->status == 'success' ) { $this->_helper->json(array('status' => 'ok')); return; } else { $error_text .= 'Response: $pploadApi->putFile(): ' . json_encode($fileResponse); } } } $this->_helper->json(array('status' => 'error', 'error_text' => $error_text)); } /** * ppload */ public function deletepploadfilesAction() { $this->_helper->layout()->disableLayout(); $projectTable = new Default_Model_DbTable_Project(); $projectData = $projectTable->find($this->_projectId)->current(); // Delete all files in ppload collection if ($projectData->ppload_collection_id) { $pploadApi = new Ppload_Api(array( 'apiUri' => PPLOAD_API_URI, 'clientId' => PPLOAD_CLIENT_ID, 'secret' => PPLOAD_SECRET )); $filesRequest = array( 'collection_id' => $projectData->ppload_collection_id, 'perpage' => 1000 ); $filesResponse = $pploadApi->getFiles($filesRequest); if (isset($filesResponse->status) && $filesResponse->status == 'success' ) { foreach ($filesResponse->files as $file) { $fileResponse = $pploadApi->deleteFile($file->id); if (!isset($fileResponse->status) || $fileResponse->status != 'success' ) { $this->_helper->json(array('status' => 'error')); return; } } } $this->_helper->json(array('status' => 'ok')); return; } $this->_helper->json(array('status' => 'error')); } /** * ppload */ /*public function deletepploadcollectionAction() { $this->_helper->layout()->disableLayout(); $projectTable = new Default_Model_DbTable_Project(); $projectData = $projectTable->find($this->_projectId)->current(); // Delete ppload collection if ($projectData->ppload_collection_id) { $pploadApi = new Ppload_Api(array( 'apiUri' => PPLOAD_API_URI, 'clientId' => PPLOAD_CLIENT_ID, 'secret' => PPLOAD_SECRET )); $collectionResponse = $pploadApi->deleteCollection($projectData->ppload_collection_id); if (isset($collectionResponse->status) && $collectionResponse->status == 'success' ) { $projectData->ppload_collection_id = null; $projectData->changed_at = new Zend_Db_Expr('NOW()'); $projectData->save(); $activityLog = new Default_Model_ActivityLog(); $activityLog->writeActivityLog( $this->_projectId, $projectData->member_id, Default_Model_ActivityLog::PROJECT_EDITED, $projectData->toArray() ); $this->_helper->json(array('status' => 'ok')); return; } } $this->_helper->json(array('status' => 'error')); }*/ public function saveproductAction() { $form = new Default_Form_Product(); // we don't need to test a file which doesn't exist in this case. The Framework stumbles if $_FILES is empty. if ($this->_request->isXmlHttpRequest() AND (count($_FILES) == 0)) { $form->removeElement('image_small_upload'); // $form->removeElement('image_big_upload'); $form->removeSubForm('gallery'); $form->removeElement('project_id'); //(workaround: Some Browsers send "0" in some cases.) } if (false === $form->isValid($_POST)) { $errors = $form->getMessages(); $messages = $this->getErrorMessages($errors); $this->_helper->json(array('status' => 'error', 'messages' => $messages)); } $formValues = $form->getValues(); $formValues['status'] = Default_Model_Project::PROJECT_INCOMPLETE; $modelProject = new Default_Model_Project(); $newProject = $modelProject->createProject($this->_authMember->member_id, $formValues, $this->_authMember->username); //$this->createSystemPlingForNewProject($newProject->project_id); //New Project in Session, for AuthValidation (owner) $this->_auth->getIdentity()->projects[$newProject->project_id] = array('project_id' => $newProject->project_id); $this->_helper->json(array('status' => 'ok', 'project_id' => $newProject->project_id)); } protected function createPling($member_id,$project_id) { $projectplings = new Default_Model_ProjectPlings(); $newVals = array('project_id' =>$project_id, 'member_id' => $member_id); $sql = $projectplings->select() ->where('member_id = ?', $this->_authMember->member_id) ->where('is_deleted = ?',0) ->where('project_id = ?', $this->_projectId, 'INTEGER'); $result = $projectplings->fetchRow($sql); if (null === $result) { $projectplings->createRow($newVals)->save(); } } /** * @param $errors * * @return array */ protected function getErrorMessages($errors) { $messages = array(); foreach ($errors as $element => $row) { if (!empty($row) && $element != 'submit') { foreach ($row as $validator => $message) { $messages[$element][] = $message; } } } return $messages; } public function searchAction() { // Filter-Parameter $params = $this->getAllParams(); $filterInput = new Zend_Filter_Input( array( '*' => 'StringTrim', 'projectSearchText' => array(new Zend_Filter_Callback('stripslashes'),'StripTags'), 'page' => 'digits', 'pci' => 'digits', 'ls' => 'digits', 't' => array(new Zend_Filter_Callback('stripslashes'),'StripTags'), 'pkg'=> array(new Zend_Filter_Callback('stripslashes'),'StripTags'), 'lic'=> array(new Zend_Filter_Callback('stripslashes'),'StripTags'), 'arch'=> array(new Zend_Filter_Callback('stripslashes'),'StripTags') ), array( 'projectSearchText' => array( new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)), 'presence' => 'required' ), 'page' => array('digits', 'default' => '1'), 'f' => array( new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)), //new Zend_Validate_InArray(array('f'=>'tags')), 'allowEmpty' => true ), 'pci' => array('digits', 'allowEmpty' => true ), 'ls' => array('digits', 'allowEmpty' => true ), 't' => array(new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)), 'allowEmpty' => true ), 'pkg' => array(new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)), 'allowEmpty' => true ), 'lic' => array(new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)), 'allowEmpty' => true ), 'arch' => array(new Zend_Validate_StringLength(array('min' => 3, 'max' => 100)), 'allowEmpty' => true) ), $params); if ($filterInput->hasInvalid()) { $this->_helper->flashMessenger->addMessage('

There was an error. Please check your input and try again.

'); return; } $this->view->searchText = $filterInput->getEscaped('projectSearchText'); $this->view->page = $filterInput->getEscaped('page'); $this->view->searchField = $filterInput->getEscaped('f'); $this->view->pci = $filterInput->getEscaped('pci'); $this->view->ls = $filterInput->getEscaped('ls'); $this->view->t = $filterInput->getEscaped('t'); $this->view->pkg = $filterInput->getEscaped('pkg'); $this->view->arch = $filterInput->getEscaped('arch'); $this->view->lic = $filterInput->getEscaped('lic'); $this->view->store = $this->getParam('domain_store_id'); if(isset($params['isJson'])) { $this->_helper->layout()->disableLayout(); $filterScore = $this->view->ls ? 'laplace_score:['.$this->view->ls.' TO '.($this->view->ls+9).']':null; $filterCat = $this->view->pci ? 'project_category_id:('.$this->view->pci.')' : null; $filterTags = $this->view->t ? 'tags:('.$this->view->t.')' : null; $filterPkg = $this->view->pkg ? 'package_names:('.$this->view->pkg.')' : null; $filterArch = $this->view->arch ? 'arch_names:('.$this->view->arch.')' : null; $filterLic = $this->view->lic ? 'license_names:('.$this->view->lic.')' : null; // $param = array('q' => $this->view->searchText ,'store'=>$this->view->store,'page' => $this->view->page // , 'count' => 10, 'qf' => $this->view->searchField, 'fq' => array($filterCat, $filterScore, $filterTags,$filterPkg,$filterArch,$filterLic)); $param = array('q' => 'test','store'=>null,'page' => 1 , 'count' => 10); $viewHelperImage = new Default_View_Helper_Image(); $modelSearch = new Default_Model_Solr(); try { $result = $modelSearch->search($param); $products = $result['hits']; // var_dump($products); // die; $ps=array(); foreach ($products as $p) { $img = $viewHelperImage->Image($p->image_small, array( 'width' => 50, 'height' => 50 )); $ps[] =array('description'=>$p->description ,'title' =>$p->title ,'project_id' =>$p->project_id ,'member_id'=>$p->member_id ,'username' => $p->username ,'laplace_score' =>$p->laplace_score ,'score' =>$p->score ,'image_small' =>$img); } $this->_helper->json(array( 'status' => 'ok', 'products' => $ps, 'q' =>$param )); } catch (Exception $e) { $this->_helper->json(array( 'status' => 'err', 'msg' => 'Not Found! Try again.' )); } } } /** * @param $memberId * * @throws Zend_Db_Table_Exception */ protected function setViewDataForMyProducts($memberId) { $tableMember = new Default_Model_Member(); $this->view->member = $tableMember->find($memberId)->current(); $tableProduct = new Default_Model_Project(); $this->view->products = $tableProduct->fetchAllProjectsForMember($memberId); } protected function _initResponseHeader() { $duration = 1800; // in seconds $expires = gmdate("D, d M Y H:i:s", time() + $duration) . " GMT"; $this->getResponse()->setHeader('X-FRAME-OPTIONS', 'ALLOWALL', true)// ->setHeader('Last-Modified', $modifiedTime, true) ->setHeader('Expires', $expires, true)->setHeader('Pragma', 'no-cache', true) ->setHeader('Cache-Control', 'private, no-cache, must-revalidate', true) ; } /** * @param $hits * * @return array */ protected function generateProjectsArrayForView($hits) { $viewArray = array(); $helperBuildProductUrl = new Default_View_Helper_BuildProductUrl(); /** @var $hit Zend_Search_Lucene_Search_QueryHit */ foreach ($hits as $hit) { $project = $hit->getDocument(); if (null != $project->username) { $isUpdate = ($project->type_id == 2); if ($isUpdate) { $showUrl = $helperBuildProductUrl->buildProductUrl($project->pid) . '#anker_' . $project->project_id; $plingUrl = $helperBuildProductUrl->buildProductUrl($project->pid, 'pling'); } else { $showUrl = $helperBuildProductUrl->buildProductUrl($project->project_id); $plingUrl = $helperBuildProductUrl->buildProductUrl($project->project_id, 'pling'); } $projectArr = array( 'score' => $hit->score, 'id' => $project->project_id, 'type_id' => $project->type_id, 'title' => $project->title, 'description' => $project->description, 'image' => $project->image_small, 'plings' => 0, 'urlGoal' => $showUrl, 'urlPling' => $plingUrl, 'showUrlPling' => ($project->paypal_mail != null), 'member' => array( 'name' => $project->username, 'url' => 'member/' . $project->member_id, 'image' => $project->profile_image_url, 'id' => $project->member_id ) ); $viewArray[] = $projectArr; } } return $viewArray; } protected function setLayout() { $layoutName = 'flat_ui_template'; $storeConfig = Zend_Registry::isRegistered('store_config') ? Zend_Registry::get('store_config') : null; if($storeConfig && $storeConfig->layout_pagedetail) { $this->_helper->layout()->setLayout($storeConfig->layout_pagedetail); }else{ $this->_helper->layout()->setLayout($layoutName); } } private function fetchGitlabProject($gitProjectId) { $gitlab = new Default_Model_Ocs_Gitlab(); try { $gitProject = $gitlab->getProject($gitProjectId); } catch (Exception $exc) { //Project is gone $modelProject = new Default_Model_Project(); $modelProject->updateProject($this->_projectId, array('is_gitlab_project' => 0, 'gitlab_project_id' => null, 'show_gitlab_project_issues' => 0, 'use_gitlab_project_readme' => 0)); $gitProject = null; } return $gitProject; } private function fetchGitlabProjectIssues($gitProjectId) { $gitlab = new Default_Model_Ocs_Gitlab(); try { $gitProjectIssues = $gitlab->getProjectIssues($gitProjectId); } catch (Exception $exc) { //Project is gone $modelProject = new Default_Model_Project(); $modelProject->updateProject($this->_projectId, array('is_gitlab_project' => 0, 'gitlab_project_id' => null, 'show_gitlab_project_issues' => 0, 'use_gitlab_project_readme' => 0)); $gitProjectIssues = null; } return $gitProjectIssues; } public function startmediaviewajaxAction() { return $this->startvideoajaxAction(); } public function startvideoajaxAction() { $this->_helper->layout()->disableLayout(); $collection_id = null; $file_id = null; $memberId = $this->_authMember->member_id; $media_view_type_id = $this->getParam('type_id'); if(!$media_view_type_id) { // default $media_view_type_id = Default_Model_DbTable_MediaViews::MEDIA_TYPE_VIDEO; } if($this->hasParam('collection_id') && $this->hasParam('file_id')) { $collection_id = $this->getParam('collection_id'); $file_id = $this->getParam('file_id'); $id = null; //Log media view try { $mediaviewsTable = new Default_Model_DbTable_MediaViews(); $id = $mediaviewsTable->getNewId(); $data = array('media_view_id' => $id, 'media_view_type_id' => $media_view_type_id, 'project_id' => $this->_projectId, 'collection_id' => $collection_id, 'file_id' => $file_id, 'start_timestamp' => new Zend_Db_Expr ('Now()'), 'ip' => $this->getRealIpAddr(), 'referer' => $this->getReferer()); if(!empty($memberId)) { $data['member_id'] = $memberId; } $data['source'] = 'OCS-Webserver'; $mediaviewsTable->createRow($data)->save(); } catch (Exception $exc) { //echo $exc->getTraceAsString(); $errorLog = Zend_Registry::get('logger'); $errorLog->err(__METHOD__ . ' - ' . $exc->getMessage() . ' ---------- ' . PHP_EOL); } $this->_helper->json(array('status' => 'success', 'MediaViewId' => $id)); return; } $this->_helper->json(array('status' => 'error')); } public function stopmediaviewajaxAction() { return $this->stopvideoajaxAction(); } public function stopvideoajaxAction() { $this->_helper->layout()->disableLayout(); $view_id = null; if($this->hasParam('media_view_id')) { $view_id = $this->getParam('media_view_id'); //Log media view stop try { $mediaviewsTable = new Default_Model_DbTable_MediaViews(); $data = array('stop_timestamp' => new Zend_Db_Expr ('Now()')); $mediaviewsTable->update($data, 'media_view_id = '. $view_id); } catch (Exception $exc) { //echo $exc->getTraceAsString(); $errorLog = Zend_Registry::get('logger'); $errorLog->err(__METHOD__ . ' - ' . $exc->getMessage() . ' ---------- ' . PHP_EOL); } $this->_helper->json(array('status' => 'success', 'MediaViewId' => $view_id)); return; } $this->_helper->json(array('status' => 'error')); } function getRealIpAddr() { if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet { $ip=$_SERVER['HTTP_CLIENT_IP']; } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy { $ip=$_SERVER['HTTP_X_FORWARDED_FOR']; } else { $ip=$_SERVER['REMOTE_ADDR']; } return $ip; } function getReferer() { $referer = null; if (!empty($_SERVER['HTTP_REFERER'])) { $referer = $_SERVER['HTTP_REFERER']; } return $referer; } private function getFilterTagFromCookie($group) { $config = Zend_Registry::get('config'); $cookieName = $config->settings->session->filter_browse_original.$group; $storedInCookie = isset($_COOKIE[$cookieName]) ? $_COOKIE[$cookieName] : NULL; return $storedInCookie; } } diff --git a/application/modules/default/models/DbTable/ProjectClone.php b/application/modules/default/models/DbTable/ProjectClone.php index 43ce2549c..d3d3cb408 100755 --- a/application/modules/default/models/DbTable/ProjectClone.php +++ b/application/modules/default/models/DbTable/ProjectClone.php @@ -1,113 +1,114 @@ . **/ class Default_Model_DbTable_ProjectClone extends Local_Model_Table { protected $_name = "project_clone"; protected $_keyColumnsForRow = array('project_clone_id'); protected $_key = 'project_clone_id'; protected $_defaultValues = array( 'project_clone_id' => null, 'project_id' => null, 'project_id_parent' => null, 'external_link' => null, 'member_id' => null, 'text' => null, 'is_deleted' => null, 'is_valid' => null, + 'project_clone_type' => null, 'created_at' => null, 'changed_at' => null, 'deleted_at' => null ); public function setDelete($project_clone_id) { $updateValues = array( 'is_deleted' => 1, ); $this->update($updateValues, 'project_clone_id=' . $project_clone_id); } public function setValid($project_clone_id) { $updateValues = array( 'is_valid' => 1, ); $this->update($updateValues, 'project_clone_id=' . $project_clone_id); } /** * @param array $data * * @return Zend_Db_Table_Rowset_Abstract */ protected function generateRowSet($data) { $classRowSet = $this->getRowsetClass(); return new $classRowSet(array( 'table' => $this, 'rowClass' => $this->getRowClass(), 'stored' => true, 'data' => $data )); } public function delete($where) { $where = parent::_whereExpr($where); /** * Build the DELETE statement */ $sql = "UPDATE " . parent::getAdapter()->quoteIdentifier($this->_name, true) . " SET `is_deleted` = 1 " . (($where) ? " WHERE $where" : ''); /** * Execute the statement and return the number of affected rows */ $stmt = parent::getAdapter()->query($sql); $result = $stmt->rowCount(); return $result; } public function listAll($startIndex, $pageSize, $sorting) { $select = $this->select()->order($sorting)->limit($pageSize, $startIndex); $rows = $this->fetchAll($select)->toArray(); $select = $this->select()->where('is_deleted = 0'); $count = $this->fetchAll($select)->count(); if (empty($rows)) { return array('rows' => array(), 'totalCount' => 0); } return array('rows' => $rows, 'totalCount' => $count); } } \ No newline at end of file diff --git a/application/modules/default/models/ProjectTagRatings.php b/application/modules/default/models/ProjectTagRatings.php new file mode 100755 index 000000000..4bdf53968 --- /dev/null +++ b/application/modules/default/models/ProjectTagRatings.php @@ -0,0 +1,101 @@ +. + **/ +class Default_Model_ProjectTagRatings +{ + + /** + * @param $project_id + */ + public function getProjectTagRatings($project_id) + { + $sql = " + SELECT + r.tag_id, + r.vote, + r.member_id, + r.tag_rating_id + FROM stat_projects p + inner join category_tag_group_rating g on p.project_category_id = g.category_id + inner join tag_group_item i on i.tag_group_id = g.tag_group_id + inner join tag_rating r on r.tag_id = i.tag_id and r.project_id = p.project_id and r.is_deleted=0 + inner join tag t on t.tag_id = r.tag_id + where p.project_id = :project_id + "; + $result = Zend_Db_Table::getDefaultAdapter()->query($sql, array('project_id' => $project_id))->fetchAll(); + return $result; + } + + public function getCategoryTagRatings($category_id) + { + $sql ="SELECT + t.tag_id as id, + t.tag_fullname as name, + tg.group_display_name + FROM category_tag_group_rating g + inner join tag_group_item i on i.tag_group_id = g.tag_group_id + inner join tag t on t.tag_id = i.tag_id + inner join tag_group tg on g.tag_group_id = tg.group_id + where g.category_id = :category_id + "; + $result = Zend_Db_Table::getDefaultAdapter()->query($sql, array('category_id' => $category_id))->fetchAll(); + return $result; + } + + /** + * @return tag_rating_id,vote/false + */ + public function checkIfVote($member_id,$project_id,$tag_id) + { + $sql = "select tag_rating_id,vote from tag_rating where member_id=:member_id and project_id=:project_id and tag_id=:tag_id + and is_deleted=0"; + $result = Zend_Db_Table::getDefaultAdapter()->fetchRow($sql,array("member_id"=>$member_id + ,"project_id"=>$project_id + ,"tag_id" =>$tag_id + )); + return $result; + if($result && $result['tag_rating_id']) + { + return $result; + }else{ + return false; + } + } + + public function doVote($member_id,$project_id,$tag_id,$vote) + { + Zend_Db_Table::getDefaultAdapter()->insert('tag_rating' + ,array('member_id' => $member_id + ,'project_id' => $project_id + ,'tag_id' => $tag_id + ,'vote' => $vote + )); + } + + public function removeVote($tag_rating_id) + { + $sql ="update tag_rating set is_deleted=1, deleted_at=now() where tag_rating_id=".$tag_rating_id; + Zend_Db_Table::getDefaultAdapter()->query($sql); + } + + +} \ No newline at end of file diff --git a/application/modules/default/plugins/AclRules.php b/application/modules/default/plugins/AclRules.php index a594ff38a..6b80cf8d7 100644 --- a/application/modules/default/plugins/AclRules.php +++ b/application/modules/default/plugins/AclRules.php @@ -1,438 +1,440 @@ . **/ class Default_Plugin_AclRules extends Zend_Acl { const ROLENAME_GUEST = 'guest'; const ROLENAME_COOKIEUSER = 'cookieuser'; const ROLENAME_FEUSER = 'feuser'; const ROLENAME_MODERATOR = 'moderator'; const ROLENAME_STAFF = 'staff'; const ROLENAME_ADMIN = 'admin'; const ROLENAME_SYSUSER = 'sysuser'; function __construct() { $this->addRole(new Zend_Acl_Role (self::ROLENAME_GUEST)); $this->addRole(new Zend_Acl_Role (self::ROLENAME_COOKIEUSER), self::ROLENAME_GUEST); $this->addRole(new Zend_Acl_Role (self::ROLENAME_FEUSER), self::ROLENAME_COOKIEUSER); $this->addRole(new Zend_Acl_Role (self::ROLENAME_MODERATOR), self::ROLENAME_FEUSER); $this->addRole(new Zend_Acl_Role (self::ROLENAME_STAFF), self::ROLENAME_FEUSER); $this->addRole(new Zend_Acl_Role (self::ROLENAME_ADMIN)); $this->addRole(new Zend_Acl_Role (self::ROLENAME_SYSUSER)); $this->addResource(new Zend_Acl_Resource ('default_logout')); $this->addResource(new Zend_Acl_Resource ('default_oauth')); $this->addResource(new Zend_Acl_Resource ('default_authorization')); $this->addResource(new Zend_Acl_Resource ('default_button')); $this->addResource(new Zend_Acl_Resource ('default_categories')); $this->addResource(new Zend_Acl_Resource ('default_community')); $this->addResource(new Zend_Acl_Resource ('default_content')); $this->addResource(new Zend_Acl_Resource ('default_discovery')); $this->addResource(new Zend_Acl_Resource ('default_donationlist')); $this->addResource(new Zend_Acl_Resource ('default_support')); $this->addResource(new Zend_Acl_Resource ('default_subscription')); $this->addResource(new Zend_Acl_Resource ('default_error')); $this->addResource(new Zend_Acl_Resource ('default_explore')); $this->addResource(new Zend_Acl_Resource ('default_gateway')); $this->addResource(new Zend_Acl_Resource ('default_hive')); $this->addResource(new Zend_Acl_Resource ('default_home')); $this->addResource(new Zend_Acl_Resource ('default_ocsv1')); // OCS API $this->addResource(new Zend_Acl_Resource ('default_embedv1')); // embed API $this->addResource(new Zend_Acl_Resource ('default_membersetting')); $this->addResource(new Zend_Acl_Resource ('default_json')); $this->addResource(new Zend_Acl_Resource ('default_productcategory')); $this->addResource(new Zend_Acl_Resource ('default_productcomment')); $this->addResource(new Zend_Acl_Resource ('default_product')); $this->addResource(new Zend_Acl_Resource ('default_report')); $this->addResource(new Zend_Acl_Resource ('default_rectification')); $this->addResource(new Zend_Acl_Resource ('default_rss')); $this->addResource(new Zend_Acl_Resource ('default_settings')); $this->addResource(new Zend_Acl_Resource ('default_supporterbox')); $this->addResource(new Zend_Acl_Resource ('default_plingbox')); $this->addResource(new Zend_Acl_Resource ('default_user')); $this->addResource(new Zend_Acl_Resource ('default_widget')); $this->addResource(new Zend_Acl_Resource ('default_file')); $this->addResource(new Zend_Acl_Resource ('default_plings')); $this->addResource(new Zend_Acl_Resource ('default_gitfaq')); $this->addResource(new Zend_Acl_Resource ('default_spam')); $this->addResource(new Zend_Acl_Resource ('default_moderation')); $this->addResource(new Zend_Acl_Resource ('default_duplicates')); $this->addResource(new Zend_Acl_Resource ('default_newproducts')); $this->addResource(new Zend_Acl_Resource ('default_misuse')); $this->addResource(new Zend_Acl_Resource ('default_credits')); $this->addResource(new Zend_Acl_Resource ('default_ads')); $this->addResource(new Zend_Acl_Resource ('default_dl')); $this->addResource(new Zend_Acl_Resource ('default_password')); $this->addResource(new Zend_Acl_Resource ('default_verify')); $this->addResource(new Zend_Acl_Resource ('default_login')); $this->addResource(new Zend_Acl_Resource ('default_collection')); $this->addResource(new Zend_Acl_Resource ('default_funding')); $this->addResource(new Zend_Acl_Resource ('default_stati')); $this->addResource(new Zend_Acl_Resource ('default_tag')); $this->addResource(new Zend_Acl_Resource ('default_section')); $this->addResource(new Zend_Acl_Resource ('default_supporters')); $this->addResource(new Zend_Acl_Resource ('backend_categories')); $this->addResource(new Zend_Acl_Resource ('backend_vcategories')); $this->addResource(new Zend_Acl_Resource ('backend_categorytag')); $this->addResource(new Zend_Acl_Resource ('backend_categorytaggroup')); $this->addResource(new Zend_Acl_Resource ('backend_claim')); $this->addResource(new Zend_Acl_Resource ('backend_comments')); $this->addResource(new Zend_Acl_Resource ('backend_content')); $this->addResource(new Zend_Acl_Resource ('backend_faq')); $this->addResource(new Zend_Acl_Resource ('backend_hive')); $this->addResource(new Zend_Acl_Resource ('backend_hiveuser')); $this->addResource(new Zend_Acl_Resource ('backend_index')); $this->addResource(new Zend_Acl_Resource ('backend_mail')); $this->addResource(new Zend_Acl_Resource ('backend_member')); $this->addResource(new Zend_Acl_Resource ('backend_memberpayout')); $this->addResource(new Zend_Acl_Resource ('backend_memberpaypaladdress')); $this->addResource(new Zend_Acl_Resource ('backend_paypalvalidstatus')); $this->addResource(new Zend_Acl_Resource ('backend_payoutstatus')); $this->addResource(new Zend_Acl_Resource ('backend_operatingsystem')); $this->addResource(new Zend_Acl_Resource ('backend_project')); $this->addResource(new Zend_Acl_Resource ('backend_ranking')); $this->addResource(new Zend_Acl_Resource ('backend_reportcomments')); $this->addResource(new Zend_Acl_Resource ('backend_reportproducts')); $this->addResource(new Zend_Acl_Resource ('backend_search')); $this->addResource(new Zend_Acl_Resource ('backend_storecategories')); $this->addResource(new Zend_Acl_Resource ('backend_vstorecategories')); $this->addResource(new Zend_Acl_Resource ('backend_store')); $this->addResource(new Zend_Acl_Resource ('backend_tag')); $this->addResource(new Zend_Acl_Resource ('backend_user')); $this->addResource(new Zend_Acl_Resource ('backend_tags')); $this->addResource(new Zend_Acl_Resource ('backend_ghnsexcluded')); $this->addResource(new Zend_Acl_Resource ('backend_letteravatar')); $this->addResource(new Zend_Acl_Resource ('backend_group')); $this->addResource(new Zend_Acl_Resource ('backend_spamkeywords')); $this->addResource(new Zend_Acl_Resource ('backend_projectclone')); $this->addResource(new Zend_Acl_Resource ('backend_section')); $this->addResource(new Zend_Acl_Resource ('backend_sectioncategories')); $this->addResource(new Zend_Acl_Resource ('backend_sponsor')); $this->addResource(new Zend_Acl_Resource ('backend_browselisttype')); $this->addResource(new Zend_Acl_Resource ('backend_cdiscourse')); $this->addResource(new Zend_Acl_Resource ('backend_cgitlab')); $this->addResource(new Zend_Acl_Resource ('backend_cldap')); $this->addResource(new Zend_Acl_Resource ('backend_coauth')); $this->addResource(new Zend_Acl_Resource ('backend_cexport')); $this->addResource(new Zend_Acl_Resource ('backend_statistics')); $this->addResource(new Zend_Acl_Resource ('statistics_data')); $this->allow(self::ROLENAME_GUEST, array( 'statistics_data' )); $this->allow(self::ROLENAME_GUEST, array( 'default_logout', 'default_authorization', 'default_button', 'default_categories', 'default_content', 'default_community', 'default_donationlist', 'default_error', 'default_explore', 'default_gateway', 'default_hive', 'default_home', 'default_membersetting', 'default_json', 'default_ocsv1', // OCS API 'default_embedv1', // embed API 'default_productcategory', 'default_rss', 'default_support', 'default_subscription', 'default_supporterbox', 'default_plingbox', 'default_oauth', 'default_plings', 'default_gitfaq', 'default_ads', 'default_dl', 'default_stati', 'default_password', 'default_verify', 'default_login', 'default_supporters', 'default_collection' )); $this->allow(self::ROLENAME_SYSUSER, array( 'default_authorization', 'default_button', 'default_categories', 'default_content', 'default_community', 'default_donationlist', 'default_error', 'default_explore', 'default_gateway', 'default_hive', 'default_home', 'default_ocsv1', // OCS API 'default_embedv1', // embed API 'default_productcategory', 'default_report', 'default_rss', 'default_supporterbox', 'default_plingbox', 'default_oauth', 'default_plings', 'default_ads', 'default_dl', 'default_stati', 'default_password' )); $this->allow(self::ROLENAME_COOKIEUSER, array( 'default_logout', 'default_productcomment', 'default_settings', 'default_tag', 'default_rectification' )); $this->allow(self::ROLENAME_STAFF, array( 'backend_index', 'backend_categories', 'backend_categorytag', 'backend_claim', 'backend_comments', 'backend_content', 'backend_store', 'backend_storecategories', 'backend_operatingsystem', 'backend_reportcomments', 'backend_reportproducts', 'backend_search', 'backend_group' )); $this->allow(self::ROLENAME_ADMIN); // resource access rights in detail $this->allow(self::ROLENAME_GUEST, 'backend_group', array('newgroup')); // resource default_product $this->allow(self::ROLENAME_GUEST, 'default_product', array( 'index', 'show', 'getupdatesajax', 'updates', 'follows', 'fetch', 'search', 'startdownload', 'ppload', 'loadratings', 'loadfilesjson', 'loadinstallinstruction', 'gettaggroupsforcatajax', 'getfilesajax', 'getfiletagsajax', 'startvideoajax', 'stopvideoajax', 'startmediaviewajax', 'stopmediaviewajax', - 'loadfirstfilejson' + 'loadfirstfilejson', + 'loadtagrating' )); // resource default_product $this->allow(self::ROLENAME_GUEST, 'default_collection', array( 'index', 'show', 'getupdatesajax', 'updates', 'follows', 'fetch', 'search', //'startdownload', //'ppload', 'loadratings', //'loadinstallinstruction', //'getfilesajax', 'gettaggroupsforcatajax' )); // resource default_product $this->allow(self::ROLENAME_SYSUSER, 'default_product', array( 'index', 'show', 'getupdatesajax', 'updates', 'follows', 'fetch', 'search', 'startdownload', 'ppload', 'loadratings' )); $this->allow(self::ROLENAME_COOKIEUSER, 'default_product', array( 'add', 'rating', 'follow', 'unfollow', 'plingproject', 'followproject', 'unplingproject', 'add', 'pling', 'pay', 'dwolla', 'paymentok', 'paymentcancel', 'saveproduct', - 'claim' + 'claim', + 'votetagrating' )); $this->allow(self::ROLENAME_COOKIEUSER, 'default_collection', array( 'add', 'rating', 'follow', 'unfollow', 'plingproject', 'followproject', 'unplingproject', 'pling', 'pay', 'dwolla', 'paymentok', 'paymentcancel', 'saveproduct', 'claim' )); $this->allow(self::ROLENAME_COOKIEUSER, 'default_membersetting', array( 'getsettings','setsettings','notification','searchmember' )); $this->allow(self::ROLENAME_MODERATOR, 'backend_project', array( 'doghnsexclude' )); $this->allow(self::ROLENAME_MODERATOR, 'default_moderation', array( 'index','list' )); $this->allow(self::ROLENAME_MODERATOR, 'default_duplicates', array( 'index' )); $this->allow(self::ROLENAME_MODERATOR, 'default_newproducts', array( 'index' )); $this->allow(self::ROLENAME_COOKIEUSER, 'default_product', array( 'edit', 'saveupdateajax', 'deleteupdateajax', 'update', 'preview', 'delete', 'unpublish', 'publish', 'verifycode', 'makerconfig', 'addpploadfile', 'updatepploadfile', 'deletepploadfile', 'deletepploadfiles', 'updatefiletag', 'getcollectionprojectsajax', 'getprojectsajax' ), new Default_Plugin_Acl_IsProjectOwnerAssertion()); // resource default_support $this->allow(self::ROLENAME_GUEST, 'default_support', array('index')); $this->allow(self::ROLENAME_COOKIEUSER, 'default_support', array('index', 'pay', 'paymentok', 'paymentcancel')); // resource default_subscription $this->allow(self::ROLENAME_GUEST, 'default_subscription', array('index', 'support2')); $this->allow(self::ROLENAME_COOKIEUSER, 'default_subscription', array('index', 'support2', 'pay', 'pay2', 'paymentok', 'paymentcancel')); // resource default_report $this->allow(self::ROLENAME_COOKIEUSER, 'default_report', array('comment', 'product', 'productfraud', 'productclone')); // resource default_widget $this->allow(self::ROLENAME_GUEST, 'default_widget', array('index', 'render')); $this->allow(self::ROLENAME_COOKIEUSER, 'default_widget', array('save', 'savedefault', 'config'), new Default_Plugin_Acl_IsProjectOwnerAssertion()); $this->allow(self::ROLENAME_COOKIEUSER, 'default_file', array( 'gitlink', 'link', ), new Default_Plugin_Acl_IsProjectOwnerAssertion()); // resource default_user $this->allow(self::ROLENAME_GUEST, 'default_home', array('baseurlajax','forumurlajax','blogurlajax','storenameajax','domainsajax', 'userdataajax', 'loginurlajax', 'metamenujs','metamenubundlejs','fetchforgit')); // resource default_user $this->allow(self::ROLENAME_GUEST, 'default_user', array('index', 'aboutme', 'share', 'report', 'about', 'tooltip', 'avatar', 'userdataajax','showoriginal')); $this->allow(self::ROLENAME_COOKIEUSER, 'default_user', array( 'follow', 'unfollow', 'settings', 'products', 'collections', 'news', 'activities', 'payments', 'income', 'payout', 'payouthistory', 'plings', 'plingsold', 'plingsajax', 'plingsmonthajax', 'downloadhistory', 'likes', 'funding', 'sectionsajax', 'sectionsmonthajax', 'sectionplingsmonthajax', 'sectioncreditsmonthajax', 'sectionaffiliatesmonthdetailajax', )); //$this->allow(self::ROLENAME_GUEST, 'default_funding', array( // 'index', // 'plingsajax', // 'plingsmonthajax' //)); $this->allow(self::ROLENAME_COOKIEUSER, 'default_tag', array('filter', 'add', 'del', 'assign', 'remove')); } } diff --git a/application/modules/default/views/scripts/product/index.phtml b/application/modules/default/views/scripts/product/index.phtml index 1702fa209..e3012e26d 100644 --- a/application/modules/default/views/scripts/product/index.phtml +++ b/application/modules/default/views/scripts/product/index.phtml @@ -1,1198 +1,1200 @@ . **/ $helpAddDefaultScheme = new Default_View_Helper_AddDefaultScheme(); $helpMemberUrl = new Default_View_Helper_BuildMemberUrl(); $helpEncryptUrl = new Default_View_Helper_EncryptUrl(); $helpImage = new Default_View_Helper_Image(); $helpTruncate = new Default_View_Helper_Truncate(); $helpProductUrl = new Default_View_Helper_BuildProductUrl(); $helpBBCode = new Default_View_Helper_Bbcode2html(); $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); $isAdmin = false; if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { $isAdmin = true; } $identity = Zend_Auth::getInstance()->getStorage()->read(); $loginUrl = '/login?redirect=' . $helpEncryptUrl->encryptUrl(Zend_Controller_Front::getInstance()->getRequest() ->getRequestUri(), true); $viewSidebar = 'product/partials/productAboutSidebar.phtml'; $viewClaimBox = false; if ($this->product->claimable == 1) { $viewClaimBox = 'product/partials/productClaimTopHeader.phtml'; } $helpProjectFiles = new Default_View_Helper_ProjectFiles(); $productFileInfos = $helpProjectFiles->projectFiles($this->product->ppload_collection_id); $this->product->title = Default_Model_HtmlPurify::purify($this->product->title); $this->product->description = Default_Model_BBCode::renderHtml(Default_Model_HtmlPurify::purify($this->product->description)); $this->product->version = Default_Model_HtmlPurify::purify($this->product->version); //$this->product->embed_code =Default_Model_HtmlPurify::purify($this->product->embed_code,Default_Model_HtmlPurify::ALLOW_EMBED); $this->product->link_1 = Default_Model_HtmlPurify::purify($helpAddDefaultScheme->addDefaultScheme($this->product->link_1),Default_Model_HtmlPurify::ALLOW_URL); $this->product->source_url = Default_Model_HtmlPurify::purify($this->product->source_url,Default_Model_HtmlPurify::ALLOW_URL); $this->product->facebook_code = Default_Model_HtmlPurify::purify($this->product->facebook_code,Default_Model_HtmlPurify::ALLOW_URL); $this->product->twitter_code = Default_Model_HtmlPurify::purify($this->product->twitter_code,Default_Model_HtmlPurify::ALLOW_URL); $this->product->google_code = Default_Model_HtmlPurify::purify($this->product->google_code,Default_Model_HtmlPurify::ALLOW_URL); $this->doctype(Zend_View_Helper_Doctype::XHTML1_RDFA); $this->headMeta()->setName('description', $helpTruncate->truncate($this->product->description, 200, '...', false, true)); $this->headMeta()->setName('title', $helpTruncate->truncate($this->product->title, 200, '...', false, true)); $this->headMeta()->appendProperty('og:url', $helpProductUrl->buildProductUrl($this->product->project_id, '', null, true)); $this->headMeta()->appendProperty('og:type', 'website'); $this->headMeta()->appendProperty('og:title', $this->product->title); $this->headMeta()->appendProperty('og:description', $helpTruncate->truncate($this->product->description, 200, '...', false, true)); $this->headMeta()->appendProperty('og:image', $helpImage->Image($this->product->image_small, array('width' => 400, 'height' => 400))); $tableProject = new Default_Model_Project(); $tableCollection = new Default_Model_Collection(); $tableProjectUpdates = new Default_Model_ProjectUpdates(); $this->updates = $tableProjectUpdates->fetchProjectUpdates($this->product->project_id); $tableProjectRatings = new Default_Model_DbTable_ProjectRating(); $this->ratings = $tableProjectRatings->fetchRating($this->product->project_id); //$cntRatingsActive = 0; // foreach ($this->ratings as $p) { // if($p['rating_active']==1) $cntRatingsActive =$cntRatingsActive+1; // } $commentModel = new Default_Model_ProjectComments(); $cntModeration = $commentModel->fetchCommentsWithTypeProjectCount(30,$this->product->project_id); if (Zend_Auth::getInstance()->hasIdentity()){ $this->ratingOfUser = $tableProjectRatings->getProjectRateForUser($this->product->project_id,$identity->member_id); } $tableProjectFollower = new Default_Model_DbTable_ProjectFollower(); $this->likes = $tableProjectFollower->fetchLikesForProject($this->product->project_id); $projectplings = new Default_Model_ProjectPlings(); $this->projectplings = $projectplings->fetchPlingsForProject($this->product->project_id); $projectsupport = new Default_Model_SectionSupport(); $this->projectaffiliates = $projectsupport->fetchAffiliatesForProject($this->product->project_id); $tagmodel = new Default_Model_Tags(); $helperUserRole = new Backend_View_Helper_UserRole(); $userRoleName = $helperUserRole->userRole(); $this->userRoleName = $userRoleName; $productTmp =$this->product->toArray(); $productTmp['image_small_absolute']=$helpImage->Image($this->product->image_small, array('width' => 400, 'height' => 400)); $productJson = Zend_Json::encode(Default_Model_Collection::cleanProductInfoForJson($productTmp)); $filesJson = $this->filesJson; $helperCatXdgType = new Default_View_Helper_CatXdgType(); $xdgTypeJson = Zend_Json::encode($helperCatXdgType->catXdgType($this->product->project_category_id)); $isowner = false; if(Zend_Auth::getInstance()->hasIdentity() && $identity->member_id==$this->product->member_id){ $isowner = true; } $this->isowner = $isowner; $filesTable = new Default_Model_DbTable_PploadFiles(); $countFiles = $filesTable->fetchFilesCntForProject($this->product->ppload_collection_id); $pics= $tableProject->getGalleryPictureSources($this->product->project_id); if(sizeof($pics)==0) { array_push($pics,$this->product->image_small); } $this->galleryPictures=array(); foreach ($pics as $p) { $this->galleryPictures[] = $this->Image($p, array('height' => '600')); } $galleryPicturesJson = Zend_Json::encode($this->galleryPictures); ?>
hasIdentity()) { ?> hasIdentity()) { ?> hasIdentity()) { ?>
product->link_1)): ?> product->title; ?> product->title; ?> translate('Edit Product') ?> product->featured=='1'){ ?> Featured isProjectOriginal($this->product->project_id)){?> Original isProjectMod($this->product->project_id)){?> Mod

product->project_category_id . '/order/latest">' . $this->product->cat_title . ' '; ?> '; $tagsuser = $tagmodel->getTagsUser($this->product->project_id, Default_Model_Tags::TAG_TYPE_PROJECT); echo ''; if(false === empty($tagsuser)) { foreach (explode(',',$tagsuser) as $tag) { ?> '; if($isowner){ $this->headLink()->appendStylesheet('/theme/flatui/css/select2.min.css'); $this->headLink()->appendStylesheet('/theme/flatui/css/select2.custmized.css'); $this->inlineScript()->appendFile('/theme/flatui/js/lib/select2.min.js'); ?> Saved inlineScript()->appendScript( ' $(document).ready(function(){ TagingProductDetail.setup(); }); '); } echo ''; ?>

Source (link to git-repo or to original if based on someone elses unmodified work): product->gitlab_project_id)) { $url = $this->gitlab_project['web_url']; $url = str_replace("http://", "https://", $url); echo ' ' . $url . ' '; } else if (false === empty($this->product->source_url)) { $target='_blank'; if (strpos($this->product->source_url, 'opencode.net') !== false) { $target='_self'; } echo '' . $this->product->source_url . ' '; if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) { $cntSameSource = $tableProject->getCountSourceurl($this->product->source_url); if($cntSameSource>1){ $link = '/p/'.$this->product->project_id.'/listsamesourceurl'; echo ' ['.$cntSameSource.']'; } } } else { echo ' Add the source-code for this project on opencode.net'; } ?>

partial( '/product/partials/projectlike.phtml', array( "authMember" => $identity, "project_id" => $this->product->project_id ) ); ?>
render('partials/sidebarRating.phtml'); ?>
render('partials/sidebarScore.phtml'); ?>
product->is_gitlab_project && $this->product->use_gitlab_project_readme && null != $this->gitlab_project['readme_url']) { ?>
Description:

readme ?>

Description:

product->description ?>
updates) > 0) { $this->productUpdate = $this->updates[0]; ?>
Last changelog: render('product/partials/productUpdatesV1.phtml'); ?>
+ +
paramPageId; $testComments = $modelComments->getCommentTreeForProject($this->product->project_id); $testComments->setItemCountPerPage(25); $testComments->setCurrentPageNumber($offset); $this->comments = $testComments; echo $this->render('product/partials/productCommentsUX1.phtml'); ?>
partial( $viewClaimBox, array( "member" => $this->member, "product" => $this->product ) ); } ?>
updates) > 0) { ?>
updates as $this->productUpdate) { echo $this->render('product/partials/productUpdatesV1.phtml'); } ?>
product->show_gitlab_project_issues) { ?>
gitlab_project_issues; $i = 0; foreach ($issues as $issue){ $date = date('Y-m-d H:i:s', strtotime($issue['created_at'])); echo '
' . $issue['title'] . '
'.$this->printDate($date).'
'; $i ++; if($i>5) { break; } } ?> Show all gitlab_project['open_issues_count'] ?> Issues
render('product/partials/productRating.phtml'); ?>
render('product/partials/productRating2.phtml'); ?>
paramPageId; $testComments = $modelComments->getCommentTreeForProject($this->product->project_id,30); $testComments->setItemCountPerPage(25); $testComments->setCurrentPageNumber($offset); $this->comments = $testComments; echo $this->render('product/partials/productCommentsUX2.phtml'); ?>
likes) > 0) { ?>
render('product/partials/productLikes.phtml'); ?>
projectplings) > 0) { ?>
render('product/partials/productPlings.phtml'); ?>
render('product/partials/productAffiliates.phtml'); ?>
render('product/partials/ppload.phtml'); ?>
*Needs pling-store or ocs-url to install things
product->claimable)) { ?>
partial( '/product/partials/projectplings.phtml', array( "authMember" => $identity, "project_id" => $this->product->project_id, "ppload_collection_id" => $this->product->ppload_collection_id, "project_category_id" => $this->product->project_category_id ) ); ?>
projectaffiliates) ?> Affiliateprojectaffiliates) == 0?'s':'' ?>projectaffiliates) > 1?'s':'' ?>
product->paypal_mail) { echo $this->partial( '/product/partials/support_box.phtml', array( "authMember" => $identity, "project_id" => $this->product->project_id, "project_title" => $this->product->title, "ppload_collection_id" => $this->product->ppload_collection_id, "project_category_id" => $this->product->project_category_id, "project_category_title" => $this->product->cat_title, "isAdmin" => $isAdmin ) ); } ?> render('partials/sidebarRating.phtml'); */ ?>
*/ ?> countAllCollectionsForProject($this->product->project_id); if($cntCollections>0) { ?>
moreProducts = $tableCollection->fetchAllCollectionsForProject($this->product->project_id, 6); $this->moreProductsTitle = 'Is part of these Collections'; if (count($this->moreProducts) > 0) { echo $this->render('product/partials/productMoreProductsWidgetV1.phtml'); } ?>
fetchOrigins($this->product->project_id); $this->moreProducts = $origins; $this->moreProductsTitle = 'Based on'; if (count($this->moreProducts) > 0) { echo $this->render('product/partials/productCloneFrom.phtml'); } ?> fetchRelatedProducts($this->product->project_id); $bflag = false; foreach ($related as $r){ $rid = $r->project_id; $bflag = false; foreach ($origins as $o){ $oid = $o->project_id; if($rid == $oid){ $bflag = true; break; } } if(!$bflag) { $relatednew[] = $r; } } $this->moreProducts = $relatednew; $this->moreProductsTitle = 'Variants'; if (count($this->moreProducts) > 0) { echo $this->render('product/partials/productCloneFrom.phtml'); } ?>
moreProducts = $tableProject->fetchMoreProjects($this->product, 6); $this->moreProductsTitle = 'More ' . $this->product->cat_title . ' from ' . $this->product->username; if (count($this->moreProducts) > 0) { echo $this->render('product/partials/productMoreProductsWidgetV1.phtml'); } ?>
moreProducts = $tableProject->fetchMoreProjectsOfOtherUsr($this->product, 6); $this->moreProductsTitle = 'Other ' . $this->product->cat_title; if (count($this->moreProducts) > 0) { echo $this->render('product/partials/productMoreProductsWidgetV1.phtml'); } ?>
render('partials/sidebarCcLicense.phtml'); ?> isProjectEbook($this->product->project_id)) { echo $this->render('product/partials/ebook_details.phtml'); } ?> render('product/partials/details.phtml'); ?> render('product/partials/tags.phtml'); ?>
- + inlineScript()->appendScript( ' $(document).ready(function(){ InitActiveHashTab.setup(); PartialJson.setup(); PartialJsonFraud.setup(); PartialJsonClone.setup(); ProductDetailCarousel.setup(); PartialCommentReviewForm.setup(); PartialCommentReviewFormNew.setup(); PartialsButtonHeartDetail.setup(); PartialsButtonPlingProject.setup(); TooltipUser.setup("tooltipuserleft","left"); AppimagequestionOnClick.setup(); Opendownloadfile.setup(); CreateScoreRatingPopup.setup(); $(\'.tooltipheart\').tooltipster({theme: [\'tooltipster-light\', \'tooltipster-light-customized\'], contentCloning: true, contentAsHTML: true, interactive: true}); }); '); diff --git a/httpdocs/theme/react/bundle/tag-rating-bundle.js b/httpdocs/theme/react/bundle/tag-rating-bundle.js new file mode 100644 index 000000000..2c3a399c8 --- /dev/null +++ b/httpdocs/theme/react/bundle/tag-rating-bundle.js @@ -0,0 +1,578 @@ +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); +/******/ } +/******/ }; +/******/ +/******/ // define __esModule on exports +/******/ __webpack_require__.r = function(exports) { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ +/******/ // create a fake namespace object +/******/ // mode & 1: value is a module id, require it +/******/ // mode & 2: merge all properties of value into the ns +/******/ // mode & 4: return value when already ns object +/******/ // mode & 8|1: behave like require +/******/ __webpack_require__.t = function(value, mode) { +/******/ if(mode & 1) value = __webpack_require__(value); +/******/ if(mode & 8) return value; +/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; +/******/ var ns = Object.create(null); +/******/ __webpack_require__.r(ns); +/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); +/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); +/******/ return ns; +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = "./tag-rating/entry-tag-rating.js"); +/******/ }) +/************************************************************************/ +/******/ ({ + +/***/ "../node_modules/axios/index.js": +/*!**************************************!*\ + !*** ../node_modules/axios/index.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +eval("module.exports = __webpack_require__(/*! ./lib/axios */ \"../node_modules/axios/lib/axios.js\");\n\n//# sourceURL=webpack:///../node_modules/axios/index.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/adapters/xhr.js": +/*!*************************************************!*\ + !*** ../node_modules/axios/lib/adapters/xhr.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"../node_modules/axios/lib/utils.js\");\nvar settle = __webpack_require__(/*! ./../core/settle */ \"../node_modules/axios/lib/core/settle.js\");\nvar buildURL = __webpack_require__(/*! ./../helpers/buildURL */ \"../node_modules/axios/lib/helpers/buildURL.js\");\nvar parseHeaders = __webpack_require__(/*! ./../helpers/parseHeaders */ \"../node_modules/axios/lib/helpers/parseHeaders.js\");\nvar isURLSameOrigin = __webpack_require__(/*! ./../helpers/isURLSameOrigin */ \"../node_modules/axios/lib/helpers/isURLSameOrigin.js\");\nvar createError = __webpack_require__(/*! ../core/createError */ \"../node_modules/axios/lib/core/createError.js\");\nvar btoa = (typeof window !== 'undefined' && window.btoa && window.btoa.bind(window)) || __webpack_require__(/*! ./../helpers/btoa */ \"../node_modules/axios/lib/helpers/btoa.js\");\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n var loadEvent = 'onreadystatechange';\n var xDomain = false;\n\n // For IE 8/9 CORS support\n // Only supports POST and GET calls and doesn't returns the response headers.\n // DON'T do this for testing b/c XMLHttpRequest is mocked, not XDomainRequest.\n if ( true &&\n typeof window !== 'undefined' &&\n window.XDomainRequest && !('withCredentials' in request) &&\n !isURLSameOrigin(config.url)) {\n request = new window.XDomainRequest();\n loadEvent = 'onload';\n xDomain = true;\n request.onprogress = function handleProgress() {};\n request.ontimeout = function handleTimeout() {};\n }\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request[loadEvent] = function handleLoad() {\n if (!request || (request.readyState !== 4 && !xDomain)) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n // IE sends 1223 instead of 204 (https://github.com/axios/axios/issues/201)\n status: request.status === 1223 ? 204 : request.status,\n statusText: request.status === 1223 ? 'No Content' : request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = __webpack_require__(/*! ./../helpers/cookies */ \"../node_modules/axios/lib/helpers/cookies.js\");\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/adapters/xhr.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/axios.js": +/*!******************************************!*\ + !*** ../node_modules/axios/lib/axios.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar utils = __webpack_require__(/*! ./utils */ \"../node_modules/axios/lib/utils.js\");\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"../node_modules/axios/lib/helpers/bind.js\");\nvar Axios = __webpack_require__(/*! ./core/Axios */ \"../node_modules/axios/lib/core/Axios.js\");\nvar defaults = __webpack_require__(/*! ./defaults */ \"../node_modules/axios/lib/defaults.js\");\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = __webpack_require__(/*! ./cancel/Cancel */ \"../node_modules/axios/lib/cancel/Cancel.js\");\naxios.CancelToken = __webpack_require__(/*! ./cancel/CancelToken */ \"../node_modules/axios/lib/cancel/CancelToken.js\");\naxios.isCancel = __webpack_require__(/*! ./cancel/isCancel */ \"../node_modules/axios/lib/cancel/isCancel.js\");\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = __webpack_require__(/*! ./helpers/spread */ \"../node_modules/axios/lib/helpers/spread.js\");\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/axios.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/cancel/Cancel.js": +/*!**************************************************!*\ + !*** ../node_modules/axios/lib/cancel/Cancel.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/cancel/Cancel.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/cancel/CancelToken.js": +/*!*******************************************************!*\ + !*** ../node_modules/axios/lib/cancel/CancelToken.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar Cancel = __webpack_require__(/*! ./Cancel */ \"../node_modules/axios/lib/cancel/Cancel.js\");\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/cancel/CancelToken.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/cancel/isCancel.js": +/*!****************************************************!*\ + !*** ../node_modules/axios/lib/cancel/isCancel.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/cancel/isCancel.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/core/Axios.js": +/*!***********************************************!*\ + !*** ../node_modules/axios/lib/core/Axios.js ***! + \***********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar defaults = __webpack_require__(/*! ./../defaults */ \"../node_modules/axios/lib/defaults.js\");\nvar utils = __webpack_require__(/*! ./../utils */ \"../node_modules/axios/lib/utils.js\");\nvar InterceptorManager = __webpack_require__(/*! ./InterceptorManager */ \"../node_modules/axios/lib/core/InterceptorManager.js\");\nvar dispatchRequest = __webpack_require__(/*! ./dispatchRequest */ \"../node_modules/axios/lib/core/dispatchRequest.js\");\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, {method: 'get'}, this.defaults, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/core/Axios.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/core/InterceptorManager.js": +/*!************************************************************!*\ + !*** ../node_modules/axios/lib/core/InterceptorManager.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"../node_modules/axios/lib/utils.js\");\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/core/InterceptorManager.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/core/createError.js": +/*!*****************************************************!*\ + !*** ../node_modules/axios/lib/core/createError.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar enhanceError = __webpack_require__(/*! ./enhanceError */ \"../node_modules/axios/lib/core/enhanceError.js\");\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/core/createError.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/core/dispatchRequest.js": +/*!*********************************************************!*\ + !*** ../node_modules/axios/lib/core/dispatchRequest.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"../node_modules/axios/lib/utils.js\");\nvar transformData = __webpack_require__(/*! ./transformData */ \"../node_modules/axios/lib/core/transformData.js\");\nvar isCancel = __webpack_require__(/*! ../cancel/isCancel */ \"../node_modules/axios/lib/cancel/isCancel.js\");\nvar defaults = __webpack_require__(/*! ../defaults */ \"../node_modules/axios/lib/defaults.js\");\nvar isAbsoluteURL = __webpack_require__(/*! ./../helpers/isAbsoluteURL */ \"../node_modules/axios/lib/helpers/isAbsoluteURL.js\");\nvar combineURLs = __webpack_require__(/*! ./../helpers/combineURLs */ \"../node_modules/axios/lib/helpers/combineURLs.js\");\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/core/dispatchRequest.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/core/enhanceError.js": +/*!******************************************************!*\ + !*** ../node_modules/axios/lib/core/enhanceError.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/core/enhanceError.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/core/settle.js": +/*!************************************************!*\ + !*** ../node_modules/axios/lib/core/settle.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar createError = __webpack_require__(/*! ./createError */ \"../node_modules/axios/lib/core/createError.js\");\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/core/settle.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/core/transformData.js": +/*!*******************************************************!*\ + !*** ../node_modules/axios/lib/core/transformData.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"../node_modules/axios/lib/utils.js\");\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/core/transformData.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/defaults.js": +/*!*********************************************!*\ + !*** ../node_modules/axios/lib/defaults.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/* WEBPACK VAR INJECTION */(function(process) {\n\nvar utils = __webpack_require__(/*! ./utils */ \"../node_modules/axios/lib/utils.js\");\nvar normalizeHeaderName = __webpack_require__(/*! ./helpers/normalizeHeaderName */ \"../node_modules/axios/lib/helpers/normalizeHeaderName.js\");\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = __webpack_require__(/*! ./adapters/xhr */ \"../node_modules/axios/lib/adapters/xhr.js\");\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = __webpack_require__(/*! ./adapters/http */ \"../node_modules/axios/lib/adapters/xhr.js\");\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../../hooks-app/node_modules/process/browser.js */ \"./node_modules/process/browser.js\")))\n\n//# sourceURL=webpack:///../node_modules/axios/lib/defaults.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/helpers/bind.js": +/*!*************************************************!*\ + !*** ../node_modules/axios/lib/helpers/bind.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/helpers/bind.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/helpers/btoa.js": +/*!*************************************************!*\ + !*** ../node_modules/axios/lib/helpers/btoa.js ***! + \*************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n// btoa polyfill for IE<10 courtesy https://github.com/davidchambers/Base64.js\n\nvar chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n\nfunction E() {\n this.message = 'String contains an invalid character';\n}\nE.prototype = new Error;\nE.prototype.code = 5;\nE.prototype.name = 'InvalidCharacterError';\n\nfunction btoa(input) {\n var str = String(input);\n var output = '';\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars;\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n str.charAt(idx | 0) || (map = '=', idx % 1);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt(63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt(idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new E();\n }\n block = block << 8 | charCode;\n }\n return output;\n}\n\nmodule.exports = btoa;\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/helpers/btoa.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/helpers/buildURL.js": +/*!*****************************************************!*\ + !*** ../node_modules/axios/lib/helpers/buildURL.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"../node_modules/axios/lib/utils.js\");\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/helpers/buildURL.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/helpers/combineURLs.js": +/*!********************************************************!*\ + !*** ../node_modules/axios/lib/helpers/combineURLs.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/helpers/combineURLs.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/helpers/cookies.js": +/*!****************************************************!*\ + !*** ../node_modules/axios/lib/helpers/cookies.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"../node_modules/axios/lib/utils.js\");\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/helpers/cookies.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/helpers/isAbsoluteURL.js": +/*!**********************************************************!*\ + !*** ../node_modules/axios/lib/helpers/isAbsoluteURL.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/helpers/isAbsoluteURL.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/helpers/isURLSameOrigin.js": +/*!************************************************************!*\ + !*** ../node_modules/axios/lib/helpers/isURLSameOrigin.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"../node_modules/axios/lib/utils.js\");\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/helpers/isURLSameOrigin.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/helpers/normalizeHeaderName.js": +/*!****************************************************************!*\ + !*** ../node_modules/axios/lib/helpers/normalizeHeaderName.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar utils = __webpack_require__(/*! ../utils */ \"../node_modules/axios/lib/utils.js\");\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/helpers/normalizeHeaderName.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/helpers/parseHeaders.js": +/*!*********************************************************!*\ + !*** ../node_modules/axios/lib/helpers/parseHeaders.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar utils = __webpack_require__(/*! ./../utils */ \"../node_modules/axios/lib/utils.js\");\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/helpers/parseHeaders.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/helpers/spread.js": +/*!***************************************************!*\ + !*** ../node_modules/axios/lib/helpers/spread.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/helpers/spread.js?"); + +/***/ }), + +/***/ "../node_modules/axios/lib/utils.js": +/*!******************************************!*\ + !*** ../node_modules/axios/lib/utils.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\n\nvar bind = __webpack_require__(/*! ./helpers/bind */ \"../node_modules/axios/lib/helpers/bind.js\");\nvar isBuffer = __webpack_require__(/*! is-buffer */ \"../node_modules/is-buffer/index.js\");\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n\n\n//# sourceURL=webpack:///../node_modules/axios/lib/utils.js?"); + +/***/ }), + +/***/ "../node_modules/is-buffer/index.js": +/*!******************************************!*\ + !*** ../node_modules/is-buffer/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n\n// The _isBuffer check is for Safari 5-7 support, because it's missing\n// Object.prototype.constructor. Remove this eventually\nmodule.exports = function (obj) {\n return obj != null && (isBuffer(obj) || isSlowBuffer(obj) || !!obj._isBuffer)\n}\n\nfunction isBuffer (obj) {\n return !!obj.constructor && typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n\n// For Node v0.10 support. Remove this eventually.\nfunction isSlowBuffer (obj) {\n return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0))\n}\n\n\n//# sourceURL=webpack:///../node_modules/is-buffer/index.js?"); + +/***/ }), + +/***/ "./node_modules/object-assign/index.js": +/*!*********************************************!*\ + !*** ./node_modules/object-assign/index.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n//# sourceURL=webpack:///./node_modules/object-assign/index.js?"); + +/***/ }), + +/***/ "./node_modules/process/browser.js": +/*!*****************************************!*\ + !*** ./node_modules/process/browser.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n//# sourceURL=webpack:///./node_modules/process/browser.js?"); + +/***/ }), + +/***/ "./node_modules/prop-types/checkPropTypes.js": +/*!***************************************************!*\ + !*** ./node_modules/prop-types/checkPropTypes.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar printWarning = function() {};\n\nif (true) {\n var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ \"./node_modules/prop-types/lib/ReactPropTypesSecret.js\");\n var loggedTypeFailures = {};\n var has = Function.call.bind(Object.prototype.hasOwnProperty);\n\n printWarning = function(text) {\n var message = 'Warning: ' + text;\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (true) {\n for (var typeSpecName in typeSpecs) {\n if (has(typeSpecs, typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n if (typeof typeSpecs[typeSpecName] !== 'function') {\n var err = Error(\n (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +\n 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.'\n );\n err.name = 'Invariant Violation';\n throw err;\n }\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n if (error && !(error instanceof Error)) {\n printWarning(\n (componentName || 'React class') + ': type specification of ' +\n location + ' `' + typeSpecName + '` is invalid; the type checker ' +\n 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +\n 'You may have forgotten to pass an argument to the type checker ' +\n 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +\n 'shape all require an argument).'\n );\n }\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n printWarning(\n 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')\n );\n }\n }\n }\n }\n}\n\n/**\n * Resets warning cache when testing.\n *\n * @private\n */\ncheckPropTypes.resetWarningCache = function() {\n if (true) {\n loggedTypeFailures = {};\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/checkPropTypes.js?"); + +/***/ }), + +/***/ "./node_modules/prop-types/lib/ReactPropTypesSecret.js": +/*!*************************************************************!*\ + !*** ./node_modules/prop-types/lib/ReactPropTypesSecret.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n//# sourceURL=webpack:///./node_modules/prop-types/lib/ReactPropTypesSecret.js?"); + +/***/ }), + +/***/ "./node_modules/react-dom/cjs/react-dom.development.js": +/*!*************************************************************!*\ + !*** ./node_modules/react-dom/cjs/react-dom.development.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("/** @license React v16.10.2\n * react-dom.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\n\n\n\nif (true) {\n (function() {\n'use strict';\n\nvar React = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\nvar _assign = __webpack_require__(/*! object-assign */ \"./node_modules/object-assign/index.js\");\nvar Scheduler = __webpack_require__(/*! scheduler */ \"./node_modules/scheduler/index.js\");\nvar checkPropTypes = __webpack_require__(/*! prop-types/checkPropTypes */ \"./node_modules/prop-types/checkPropTypes.js\");\nvar tracing = __webpack_require__(/*! scheduler/tracing */ \"./node_modules/scheduler/tracing.js\");\n\n// Do not require this module directly! Use normal `invariant` calls with\n// template literal strings. The messages will be converted to ReactError during\n// build, and in production they will be minified.\n\n// Do not require this module directly! Use normal `invariant` calls with\n// template literal strings. The messages will be converted to ReactError during\n// build, and in production they will be minified.\nfunction ReactError(error) {\n error.name = 'Invariant Violation';\n return error;\n}\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\n(function () {\n if (!React) {\n {\n throw ReactError(Error(\"ReactDOM was loaded before React. Make sure you load the React package before loading ReactDOM.\"));\n }\n }\n})();\n\n/**\n * Injectable ordering of event plugins.\n */\nvar eventPluginOrder = null;\n/**\n * Injectable mapping from names to event plugin modules.\n */\n\nvar namesToPlugins = {};\n/**\n * Recomputes the plugin list using the injected plugins and plugin ordering.\n *\n * @private\n */\n\nfunction recomputePluginOrdering() {\n if (!eventPluginOrder) {\n // Wait until an `eventPluginOrder` is injected.\n return;\n }\n\n for (var pluginName in namesToPlugins) {\n var pluginModule = namesToPlugins[pluginName];\n var pluginIndex = eventPluginOrder.indexOf(pluginName);\n\n (function () {\n if (!(pluginIndex > -1)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject event plugins that do not exist in the plugin ordering, `\" + pluginName + \"`.\"));\n }\n }\n })();\n\n if (plugins[pluginIndex]) {\n continue;\n }\n\n (function () {\n if (!pluginModule.extractEvents) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Event plugins must implement an `extractEvents` method, but `\" + pluginName + \"` does not.\"));\n }\n }\n })();\n\n plugins[pluginIndex] = pluginModule;\n var publishedEvents = pluginModule.eventTypes;\n\n for (var eventName in publishedEvents) {\n (function () {\n if (!publishEventForPlugin(publishedEvents[eventName], pluginModule, eventName)) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Failed to publish event `\" + eventName + \"` for plugin `\" + pluginName + \"`.\"));\n }\n }\n })();\n }\n }\n}\n/**\n * Publishes an event so that it can be dispatched by the supplied plugin.\n *\n * @param {object} dispatchConfig Dispatch configuration for the event.\n * @param {object} PluginModule Plugin publishing the event.\n * @return {boolean} True if the event was successfully published.\n * @private\n */\n\n\nfunction publishEventForPlugin(dispatchConfig, pluginModule, eventName) {\n (function () {\n if (!!eventNameDispatchConfigs.hasOwnProperty(eventName)) {\n {\n throw ReactError(Error(\"EventPluginHub: More than one plugin attempted to publish the same event name, `\" + eventName + \"`.\"));\n }\n }\n })();\n\n eventNameDispatchConfigs[eventName] = dispatchConfig;\n var phasedRegistrationNames = dispatchConfig.phasedRegistrationNames;\n\n if (phasedRegistrationNames) {\n for (var phaseName in phasedRegistrationNames) {\n if (phasedRegistrationNames.hasOwnProperty(phaseName)) {\n var phasedRegistrationName = phasedRegistrationNames[phaseName];\n publishRegistrationName(phasedRegistrationName, pluginModule, eventName);\n }\n }\n\n return true;\n } else if (dispatchConfig.registrationName) {\n publishRegistrationName(dispatchConfig.registrationName, pluginModule, eventName);\n return true;\n }\n\n return false;\n}\n/**\n * Publishes a registration name that is used to identify dispatched events.\n *\n * @param {string} registrationName Registration name to add.\n * @param {object} PluginModule Plugin publishing the event.\n * @private\n */\n\n\nfunction publishRegistrationName(registrationName, pluginModule, eventName) {\n (function () {\n if (!!registrationNameModules[registrationName]) {\n {\n throw ReactError(Error(\"EventPluginHub: More than one plugin attempted to publish the same registration name, `\" + registrationName + \"`.\"));\n }\n }\n })();\n\n registrationNameModules[registrationName] = pluginModule;\n registrationNameDependencies[registrationName] = pluginModule.eventTypes[eventName].dependencies;\n\n {\n var lowerCasedName = registrationName.toLowerCase();\n possibleRegistrationNames[lowerCasedName] = registrationName;\n\n if (registrationName === 'onDoubleClick') {\n possibleRegistrationNames.ondblclick = registrationName;\n }\n }\n}\n/**\n * Registers plugins so that they can extract and dispatch events.\n *\n * @see {EventPluginHub}\n */\n\n/**\n * Ordered list of injected plugins.\n */\n\n\nvar plugins = [];\n/**\n * Mapping from event name to dispatch config\n */\n\nvar eventNameDispatchConfigs = {};\n/**\n * Mapping from registration name to plugin module\n */\n\nvar registrationNameModules = {};\n/**\n * Mapping from registration name to event name\n */\n\nvar registrationNameDependencies = {};\n/**\n * Mapping from lowercase registration names to the properly cased version,\n * used to warn in the case of missing event handlers. Available\n * only in true.\n * @type {Object}\n */\n\nvar possibleRegistrationNames = {}; // Trust the developer to only use possibleRegistrationNames in true\n\n/**\n * Injects an ordering of plugins (by plugin name). This allows the ordering\n * to be decoupled from injection of the actual plugins so that ordering is\n * always deterministic regardless of packaging, on-the-fly injection, etc.\n *\n * @param {array} InjectedEventPluginOrder\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginOrder}\n */\n\nfunction injectEventPluginOrder(injectedEventPluginOrder) {\n (function () {\n if (!!eventPluginOrder) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject event plugin ordering more than once. You are likely trying to load more than one copy of React.\"));\n }\n }\n })(); // Clone the ordering so it cannot be dynamically mutated.\n\n\n eventPluginOrder = Array.prototype.slice.call(injectedEventPluginOrder);\n recomputePluginOrdering();\n}\n/**\n * Injects plugins to be used by `EventPluginHub`. The plugin names must be\n * in the ordering injected by `injectEventPluginOrder`.\n *\n * Plugins can be injected as part of page initialization or on-the-fly.\n *\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n * @internal\n * @see {EventPluginHub.injection.injectEventPluginsByName}\n */\n\nfunction injectEventPluginsByName(injectedNamesToPlugins) {\n var isOrderingDirty = false;\n\n for (var pluginName in injectedNamesToPlugins) {\n if (!injectedNamesToPlugins.hasOwnProperty(pluginName)) {\n continue;\n }\n\n var pluginModule = injectedNamesToPlugins[pluginName];\n\n if (!namesToPlugins.hasOwnProperty(pluginName) || namesToPlugins[pluginName] !== pluginModule) {\n (function () {\n if (!!namesToPlugins[pluginName]) {\n {\n throw ReactError(Error(\"EventPluginRegistry: Cannot inject two different event plugins using the same name, `\" + pluginName + \"`.\"));\n }\n }\n })();\n\n namesToPlugins[pluginName] = pluginModule;\n isOrderingDirty = true;\n }\n }\n\n if (isOrderingDirty) {\n recomputePluginOrdering();\n }\n}\n\nvar invokeGuardedCallbackImpl = function (name, func, context, a, b, c, d, e, f) {\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n try {\n func.apply(context, funcArgs);\n } catch (error) {\n this.onError(error);\n }\n};\n\n{\n // In DEV mode, we swap out invokeGuardedCallback for a special version\n // that plays more nicely with the browser's DevTools. The idea is to preserve\n // \"Pause on exceptions\" behavior. Because React wraps all user-provided\n // functions in invokeGuardedCallback, and the production version of\n // invokeGuardedCallback uses a try-catch, all user exceptions are treated\n // like caught exceptions, and the DevTools won't pause unless the developer\n // takes the extra step of enabling pause on caught exceptions. This is\n // unintuitive, though, because even though React has caught the error, from\n // the developer's perspective, the error is uncaught.\n //\n // To preserve the expected \"Pause on exceptions\" behavior, we don't use a\n // try-catch in DEV. Instead, we synchronously dispatch a fake event to a fake\n // DOM node, and call the user-provided callback from inside an event handler\n // for that fake event. If the callback throws, the error is \"captured\" using\n // a global event handler. But because the error happens in a different\n // event loop context, it does not interrupt the normal program flow.\n // Effectively, this gives us try-catch behavior without actually using\n // try-catch. Neat!\n // Check that the browser supports the APIs we need to implement our special\n // DEV version of invokeGuardedCallback\n if (typeof window !== 'undefined' && typeof window.dispatchEvent === 'function' && typeof document !== 'undefined' && typeof document.createEvent === 'function') {\n var fakeNode = document.createElement('react');\n\n var invokeGuardedCallbackDev = function (name, func, context, a, b, c, d, e, f) {\n // If document doesn't exist we know for sure we will crash in this method\n // when we call document.createEvent(). However this can cause confusing\n // errors: https://github.com/facebookincubator/create-react-app/issues/3482\n // So we preemptively throw with a better message instead.\n (function () {\n if (!(typeof document !== 'undefined')) {\n {\n throw ReactError(Error(\"The `document` global was defined when React was initialized, but is not defined anymore. This can happen in a test environment if a component schedules an update from an asynchronous callback, but the test has already finished running. To solve this, you can either unmount the component at the end of your test (and ensure that any asynchronous operations get canceled in `componentWillUnmount`), or you can change the test itself to be asynchronous.\"));\n }\n }\n })();\n\n var evt = document.createEvent('Event'); // Keeps track of whether the user-provided callback threw an error. We\n // set this to true at the beginning, then set it to false right after\n // calling the function. If the function errors, `didError` will never be\n // set to false. This strategy works even if the browser is flaky and\n // fails to call our global error handler, because it doesn't rely on\n // the error event at all.\n\n var didError = true; // Keeps track of the value of window.event so that we can reset it\n // during the callback to let user code access window.event in the\n // browsers that support it.\n\n var windowEvent = window.event; // Keeps track of the descriptor of window.event to restore it after event\n // dispatching: https://github.com/facebook/react/issues/13688\n\n var windowEventDescriptor = Object.getOwnPropertyDescriptor(window, 'event'); // Create an event handler for our fake event. We will synchronously\n // dispatch our fake event using `dispatchEvent`. Inside the handler, we\n // call the user-provided callback.\n\n var funcArgs = Array.prototype.slice.call(arguments, 3);\n\n function callCallback() {\n // We immediately remove the callback from event listeners so that\n // nested `invokeGuardedCallback` calls do not clash. Otherwise, a\n // nested call would trigger the fake event handlers of any call higher\n // in the stack.\n fakeNode.removeEventListener(evtType, callCallback, false); // We check for window.hasOwnProperty('event') to prevent the\n // window.event assignment in both IE <= 10 as they throw an error\n // \"Member not found\" in strict mode, and in Firefox which does not\n // support window.event.\n\n if (typeof window.event !== 'undefined' && window.hasOwnProperty('event')) {\n window.event = windowEvent;\n }\n\n func.apply(context, funcArgs);\n didError = false;\n } // Create a global error event handler. We use this to capture the value\n // that was thrown. It's possible that this error handler will fire more\n // than once; for example, if non-React code also calls `dispatchEvent`\n // and a handler for that event throws. We should be resilient to most of\n // those cases. Even if our error event handler fires more than once, the\n // last error event is always used. If the callback actually does error,\n // we know that the last error event is the correct one, because it's not\n // possible for anything else to have happened in between our callback\n // erroring and the code that follows the `dispatchEvent` call below. If\n // the callback doesn't error, but the error event was fired, we know to\n // ignore it because `didError` will be false, as described above.\n\n\n var error; // Use this to track whether the error event is ever called.\n\n var didSetError = false;\n var isCrossOriginError = false;\n\n function handleWindowError(event) {\n error = event.error;\n didSetError = true;\n\n if (error === null && event.colno === 0 && event.lineno === 0) {\n isCrossOriginError = true;\n }\n\n if (event.defaultPrevented) {\n // Some other error handler has prevented default.\n // Browsers silence the error report if this happens.\n // We'll remember this to later decide whether to log it or not.\n if (error != null && typeof error === 'object') {\n try {\n error._suppressLogging = true;\n } catch (inner) {// Ignore.\n }\n }\n }\n } // Create a fake event type.\n\n\n var evtType = \"react-\" + (name ? name : 'invokeguardedcallback'); // Attach our event handlers\n\n window.addEventListener('error', handleWindowError);\n fakeNode.addEventListener(evtType, callCallback, false); // Synchronously dispatch our fake event. If the user-provided function\n // errors, it will trigger our global error handler.\n\n evt.initEvent(evtType, false, false);\n fakeNode.dispatchEvent(evt);\n\n if (windowEventDescriptor) {\n Object.defineProperty(window, 'event', windowEventDescriptor);\n }\n\n if (didError) {\n if (!didSetError) {\n // The callback errored, but the error event never fired.\n error = new Error('An error was thrown inside one of your components, but React ' + \"doesn't know what it was. This is likely due to browser \" + 'flakiness. React does its best to preserve the \"Pause on ' + 'exceptions\" behavior of the DevTools, which requires some ' + \"DEV-mode only tricks. It's possible that these don't work in \" + 'your browser. Try triggering the error in production mode, ' + 'or switching to a modern browser. If you suspect that this is ' + 'actually an issue with React, please file an issue.');\n } else if (isCrossOriginError) {\n error = new Error(\"A cross-origin error was thrown. React doesn't have access to \" + 'the actual error object in development. ' + 'See https://fb.me/react-crossorigin-error for more information.');\n }\n\n this.onError(error);\n } // Remove our event listeners\n\n\n window.removeEventListener('error', handleWindowError);\n };\n\n invokeGuardedCallbackImpl = invokeGuardedCallbackDev;\n }\n}\n\nvar invokeGuardedCallbackImpl$1 = invokeGuardedCallbackImpl;\n\nvar hasError = false;\nvar caughtError = null; // Used by event system to capture/rethrow the first error.\n\nvar hasRethrowError = false;\nvar rethrowError = null;\nvar reporter = {\n onError: function (error) {\n hasError = true;\n caughtError = error;\n }\n};\n/**\n * Call a function while guarding against errors that happens within it.\n * Returns an error if it throws, otherwise null.\n *\n * In production, this is implemented using a try-catch. The reason we don't\n * use a try-catch directly is so that we can swap out a different\n * implementation in DEV mode.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n\nfunction invokeGuardedCallback(name, func, context, a, b, c, d, e, f) {\n hasError = false;\n caughtError = null;\n invokeGuardedCallbackImpl$1.apply(reporter, arguments);\n}\n/**\n * Same as invokeGuardedCallback, but instead of returning an error, it stores\n * it in a global so it can be rethrown by `rethrowCaughtError` later.\n * TODO: See if caughtError and rethrowError can be unified.\n *\n * @param {String} name of the guard to use for logging or debugging\n * @param {Function} func The function to invoke\n * @param {*} context The context to use when calling the function\n * @param {...*} args Arguments for function\n */\n\nfunction invokeGuardedCallbackAndCatchFirstError(name, func, context, a, b, c, d, e, f) {\n invokeGuardedCallback.apply(this, arguments);\n\n if (hasError) {\n var error = clearCaughtError();\n\n if (!hasRethrowError) {\n hasRethrowError = true;\n rethrowError = error;\n }\n }\n}\n/**\n * During execution of guarded functions we will capture the first error which\n * we will rethrow to be handled by the top level error handler.\n */\n\nfunction rethrowCaughtError() {\n if (hasRethrowError) {\n var error = rethrowError;\n hasRethrowError = false;\n rethrowError = null;\n throw error;\n }\n}\nfunction hasCaughtError() {\n return hasError;\n}\nfunction clearCaughtError() {\n if (hasError) {\n var error = caughtError;\n hasError = false;\n caughtError = null;\n return error;\n } else {\n (function () {\n {\n {\n throw ReactError(Error(\"clearCaughtError was called but no error was captured. This error is likely caused by a bug in React. Please file an issue.\"));\n }\n }\n })();\n }\n}\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\nvar warningWithoutStack = function () {};\n\n{\n warningWithoutStack = function (condition, format) {\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n if (format === undefined) {\n throw new Error('`warningWithoutStack(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (args.length > 8) {\n // Check before the condition to catch violations early.\n throw new Error('warningWithoutStack() currently supports at most 8 arguments.');\n }\n\n if (condition) {\n return;\n }\n\n if (typeof console !== 'undefined') {\n var argsWithFormat = args.map(function (item) {\n return '' + item;\n });\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n\n Function.prototype.apply.call(console.error, console, argsWithFormat);\n }\n\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n throw new Error(message);\n } catch (x) {}\n };\n}\n\nvar warningWithoutStack$1 = warningWithoutStack;\n\nvar getFiberCurrentPropsFromNode = null;\nvar getInstanceFromNode = null;\nvar getNodeFromInstance = null;\nfunction setComponentTree(getFiberCurrentPropsFromNodeImpl, getInstanceFromNodeImpl, getNodeFromInstanceImpl) {\n getFiberCurrentPropsFromNode = getFiberCurrentPropsFromNodeImpl;\n getInstanceFromNode = getInstanceFromNodeImpl;\n getNodeFromInstance = getNodeFromInstanceImpl;\n\n {\n !(getNodeFromInstance && getInstanceFromNode) ? warningWithoutStack$1(false, 'EventPluginUtils.setComponentTree(...): Injected ' + 'module is missing getNodeFromInstance or getInstanceFromNode.') : void 0;\n }\n}\nvar validateEventDispatches;\n\n{\n validateEventDispatches = function (event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n var listenersIsArr = Array.isArray(dispatchListeners);\n var listenersLen = listenersIsArr ? dispatchListeners.length : dispatchListeners ? 1 : 0;\n var instancesIsArr = Array.isArray(dispatchInstances);\n var instancesLen = instancesIsArr ? dispatchInstances.length : dispatchInstances ? 1 : 0;\n !(instancesIsArr === listenersIsArr && instancesLen === listenersLen) ? warningWithoutStack$1(false, 'EventPluginUtils: Invalid `event`.') : void 0;\n };\n}\n/**\n * Dispatch the event to the listener.\n * @param {SyntheticEvent} event SyntheticEvent to handle\n * @param {function} listener Application-level callback\n * @param {*} inst Internal component instance\n */\n\n\nfunction executeDispatch(event, listener, inst) {\n var type = event.type || 'unknown-event';\n event.currentTarget = getNodeFromInstance(inst);\n invokeGuardedCallbackAndCatchFirstError(type, listener, undefined, event);\n event.currentTarget = null;\n}\n/**\n * Standard/simple iteration through an event's collected dispatches.\n */\n\nfunction executeDispatchesInOrder(event) {\n var dispatchListeners = event._dispatchListeners;\n var dispatchInstances = event._dispatchInstances;\n\n {\n validateEventDispatches(event);\n }\n\n if (Array.isArray(dispatchListeners)) {\n for (var i = 0; i < dispatchListeners.length; i++) {\n if (event.isPropagationStopped()) {\n break;\n } // Listeners and Instances are two parallel arrays that are always in sync.\n\n\n executeDispatch(event, dispatchListeners[i], dispatchInstances[i]);\n }\n } else if (dispatchListeners) {\n executeDispatch(event, dispatchListeners, dispatchInstances);\n }\n\n event._dispatchListeners = null;\n event._dispatchInstances = null;\n}\n/**\n * @see executeDispatchesInOrderStopAtTrueImpl\n */\n\n\n\n/**\n * Execution of a \"direct\" dispatch - there must be at most one dispatch\n * accumulated on the event or it is considered an error. It doesn't really make\n * sense for an event with multiple dispatches (bubbled) to keep track of the\n * return values at each dispatch execution, but it does tend to make sense when\n * dealing with \"direct\" dispatches.\n *\n * @return {*} The return value of executing the single dispatch.\n */\n\n\n/**\n * @param {SyntheticEvent} event\n * @return {boolean} True iff number of dispatches accumulated is greater than 0.\n */\n\n/**\n * Accumulates items that must not be null or undefined into the first one. This\n * is used to conserve memory by avoiding array allocations, and thus sacrifices\n * API cleanness. Since `current` can be null before being passed in and not\n * null after this function, make sure to assign it back to `current`:\n *\n * `a = accumulateInto(a, b);`\n *\n * This API should be sparingly used. Try `accumulate` for something cleaner.\n *\n * @return {*|array<*>} An accumulation of items.\n */\n\nfunction accumulateInto(current, next) {\n (function () {\n if (!(next != null)) {\n {\n throw ReactError(Error(\"accumulateInto(...): Accumulated items must not be null or undefined.\"));\n }\n }\n })();\n\n if (current == null) {\n return next;\n } // Both are not empty. Warning: Never call x.concat(y) when you are not\n // certain that x is an Array (x could be a string with concat method).\n\n\n if (Array.isArray(current)) {\n if (Array.isArray(next)) {\n current.push.apply(current, next);\n return current;\n }\n\n current.push(next);\n return current;\n }\n\n if (Array.isArray(next)) {\n // A bit too dangerous to mutate `next`.\n return [current].concat(next);\n }\n\n return [current, next];\n}\n\n/**\n * @param {array} arr an \"accumulation\" of items which is either an Array or\n * a single item. Useful when paired with the `accumulate` module. This is a\n * simple utility that allows us to reason about a collection of items, but\n * handling the case when there is exactly one item (and we do not need to\n * allocate an array).\n * @param {function} cb Callback invoked with each element or a collection.\n * @param {?} [scope] Scope used as `this` in a callback.\n */\nfunction forEachAccumulated(arr, cb, scope) {\n if (Array.isArray(arr)) {\n arr.forEach(cb, scope);\n } else if (arr) {\n cb.call(scope, arr);\n }\n}\n\n/**\n * Internal queue of events that have accumulated their dispatches and are\n * waiting to have their dispatches executed.\n */\n\nvar eventQueue = null;\n/**\n * Dispatches an event and releases it back into the pool, unless persistent.\n *\n * @param {?object} event Synthetic event to be dispatched.\n * @private\n */\n\nvar executeDispatchesAndRelease = function (event) {\n if (event) {\n executeDispatchesInOrder(event);\n\n if (!event.isPersistent()) {\n event.constructor.release(event);\n }\n }\n};\n\nvar executeDispatchesAndReleaseTopLevel = function (e) {\n return executeDispatchesAndRelease(e);\n};\n\nfunction runEventsInBatch(events) {\n if (events !== null) {\n eventQueue = accumulateInto(eventQueue, events);\n } // Set `eventQueue` to null before processing it so that we can tell if more\n // events get enqueued while processing.\n\n\n var processingEventQueue = eventQueue;\n eventQueue = null;\n\n if (!processingEventQueue) {\n return;\n }\n\n forEachAccumulated(processingEventQueue, executeDispatchesAndReleaseTopLevel);\n\n (function () {\n if (!!eventQueue) {\n {\n throw ReactError(Error(\"processEventQueue(): Additional events were enqueued while processing an event queue. Support for this has not yet been implemented.\"));\n }\n }\n })(); // This would be a good time to rethrow if any of the event handlers threw.\n\n\n rethrowCaughtError();\n}\n\nfunction isInteractive(tag) {\n return tag === 'button' || tag === 'input' || tag === 'select' || tag === 'textarea';\n}\n\nfunction shouldPreventMouseEvent(name, type, props) {\n switch (name) {\n case 'onClick':\n case 'onClickCapture':\n case 'onDoubleClick':\n case 'onDoubleClickCapture':\n case 'onMouseDown':\n case 'onMouseDownCapture':\n case 'onMouseMove':\n case 'onMouseMoveCapture':\n case 'onMouseUp':\n case 'onMouseUpCapture':\n return !!(props.disabled && isInteractive(type));\n\n default:\n return false;\n }\n}\n/**\n * This is a unified interface for event plugins to be installed and configured.\n *\n * Event plugins can implement the following properties:\n *\n * `extractEvents` {function(string, DOMEventTarget, string, object): *}\n * Required. When a top-level event is fired, this method is expected to\n * extract synthetic events that will in turn be queued and dispatched.\n *\n * `eventTypes` {object}\n * Optional, plugins that fire events must publish a mapping of registration\n * names that are used to register listeners. Values of this mapping must\n * be objects that contain `registrationName` or `phasedRegistrationNames`.\n *\n * `executeDispatch` {function(object, function, string)}\n * Optional, allows plugins to override how an event gets dispatched. By\n * default, the listener is simply invoked.\n *\n * Each plugin that is injected into `EventsPluginHub` is immediately operable.\n *\n * @public\n */\n\n/**\n * Methods for injecting dependencies.\n */\n\n\nvar injection = {\n /**\n * @param {array} InjectedEventPluginOrder\n * @public\n */\n injectEventPluginOrder: injectEventPluginOrder,\n\n /**\n * @param {object} injectedNamesToPlugins Map from names to plugin modules.\n */\n injectEventPluginsByName: injectEventPluginsByName\n};\n/**\n * @param {object} inst The instance, which is the source of events.\n * @param {string} registrationName Name of listener (e.g. `onClick`).\n * @return {?function} The stored callback.\n */\n\nfunction getListener(inst, registrationName) {\n var listener; // TODO: shouldPreventMouseEvent is DOM-specific and definitely should not\n // live here; needs to be moved to a better place soon\n\n var stateNode = inst.stateNode;\n\n if (!stateNode) {\n // Work in progress (ex: onload events in incremental mode).\n return null;\n }\n\n var props = getFiberCurrentPropsFromNode(stateNode);\n\n if (!props) {\n // Work in progress.\n return null;\n }\n\n listener = props[registrationName];\n\n if (shouldPreventMouseEvent(registrationName, inst.type, props)) {\n return null;\n }\n\n (function () {\n if (!(!listener || typeof listener === 'function')) {\n {\n throw ReactError(Error(\"Expected `\" + registrationName + \"` listener to be a function, instead got a value of `\" + typeof listener + \"` type.\"));\n }\n }\n })();\n\n return listener;\n}\n/**\n * Allows registered plugins an opportunity to extract events from top-level\n * native browser events.\n *\n * @return {*} An accumulation of synthetic events.\n * @internal\n */\n\nfunction extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var events = null;\n\n for (var i = 0; i < plugins.length; i++) {\n // Not every plugin in the ordering may be loaded at runtime.\n var possiblePlugin = plugins[i];\n\n if (possiblePlugin) {\n var extractedEvents = possiblePlugin.extractEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n\n if (extractedEvents) {\n events = accumulateInto(events, extractedEvents);\n }\n }\n }\n\n return events;\n}\n\nfunction runExtractedPluginEventsInBatch(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var events = extractPluginEvents(topLevelType, targetInst, nativeEvent, nativeEventTarget, eventSystemFlags);\n runEventsInBatch(events);\n}\n\nvar FunctionComponent = 0;\nvar ClassComponent = 1;\nvar IndeterminateComponent = 2; // Before we know whether it is function or class\n\nvar HostRoot = 3; // Root of a host tree. Could be nested inside another node.\n\nvar HostPortal = 4; // A subtree. Could be an entry point to a different renderer.\n\nvar HostComponent = 5;\nvar HostText = 6;\nvar Fragment = 7;\nvar Mode = 8;\nvar ContextConsumer = 9;\nvar ContextProvider = 10;\nvar ForwardRef = 11;\nvar Profiler = 12;\nvar SuspenseComponent = 13;\nvar MemoComponent = 14;\nvar SimpleMemoComponent = 15;\nvar LazyComponent = 16;\nvar IncompleteClassComponent = 17;\nvar DehydratedFragment = 18;\nvar SuspenseListComponent = 19;\nvar FundamentalComponent = 20;\nvar ScopeComponent = 21;\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; // Prevent newer renderers from RTE when used with older react package versions.\n// Current owner and dispatcher used to share the same ref,\n// but PR #14548 split them out to better support the react-debug-tools package.\n\nif (!ReactSharedInternals.hasOwnProperty('ReactCurrentDispatcher')) {\n ReactSharedInternals.ReactCurrentDispatcher = {\n current: null\n };\n}\n\nif (!ReactSharedInternals.hasOwnProperty('ReactCurrentBatchConfig')) {\n ReactSharedInternals.ReactCurrentBatchConfig = {\n suspense: null\n };\n}\n\nvar BEFORE_SLASH_RE = /^(.*)[\\\\\\/]/;\nvar describeComponentFrame = function (name, source, ownerName) {\n var sourceInfo = '';\n\n if (source) {\n var path = source.fileName;\n var fileName = path.replace(BEFORE_SLASH_RE, '');\n\n {\n // In DEV, include code for a common special case:\n // prefer \"folder/index.js\" instead of just \"index.js\".\n if (/^index\\./.test(fileName)) {\n var match = path.match(BEFORE_SLASH_RE);\n\n if (match) {\n var pathBeforeSlash = match[1];\n\n if (pathBeforeSlash) {\n var folderName = pathBeforeSlash.replace(BEFORE_SLASH_RE, '');\n fileName = folderName + '/' + fileName;\n }\n }\n }\n }\n\n sourceInfo = ' (at ' + fileName + ':' + source.lineNumber + ')';\n } else if (ownerName) {\n sourceInfo = ' (created by ' + ownerName + ')';\n }\n\n return '\\n in ' + (name || 'Unknown') + sourceInfo;\n};\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\n\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\nvar MAYBE_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\nvar FAUX_ITERATOR_SYMBOL = '@@iterator';\nfunction getIteratorFn(maybeIterable) {\n if (maybeIterable === null || typeof maybeIterable !== 'object') {\n return null;\n }\n\n var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];\n\n if (typeof maybeIterator === 'function') {\n return maybeIterator;\n }\n\n return null;\n}\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = warningWithoutStack$1;\n\n{\n warning = function (condition, format) {\n if (condition) {\n return;\n }\n\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum(); // eslint-disable-next-line react-internal/warning-and-invariant-args\n\n for (var _len = arguments.length, args = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {\n args[_key - 2] = arguments[_key];\n }\n\n warningWithoutStack$1.apply(void 0, [false, format + '%s'].concat(args, [stack]));\n };\n}\n\nvar warning$1 = warning;\n\nvar Uninitialized = -1;\nvar Pending = 0;\nvar Resolved = 1;\nvar Rejected = 2;\nfunction refineResolvedLazyComponent(lazyComponent) {\n return lazyComponent._status === Resolved ? lazyComponent._result : null;\n}\nfunction initializeLazyComponentType(lazyComponent) {\n if (lazyComponent._status === Uninitialized) {\n lazyComponent._status = Pending;\n var ctor = lazyComponent._ctor;\n var thenable = ctor();\n lazyComponent._result = thenable;\n thenable.then(function (moduleObject) {\n if (lazyComponent._status === Pending) {\n var defaultExport = moduleObject.default;\n\n {\n if (defaultExport === undefined) {\n warning$1(false, 'lazy: Expected the result of a dynamic import() call. ' + 'Instead received: %s\\n\\nYour code should look like: \\n ' + \"const MyComponent = lazy(() => import('./MyComponent'))\", moduleObject);\n }\n }\n\n lazyComponent._status = Resolved;\n lazyComponent._result = defaultExport;\n }\n }, function (error) {\n if (lazyComponent._status === Pending) {\n lazyComponent._status = Rejected;\n lazyComponent._result = error;\n }\n });\n }\n}\n\nfunction getWrappedName(outerType, innerType, wrapperName) {\n var functionName = innerType.displayName || innerType.name || '';\n return outerType.displayName || (functionName !== '' ? wrapperName + \"(\" + functionName + \")\" : wrapperName);\n}\n\nfunction getComponentName(type) {\n if (type == null) {\n // Host root, text node or just invalid type.\n return null;\n }\n\n {\n if (typeof type.tag === 'number') {\n warningWithoutStack$1(false, 'Received an unexpected object in getComponentName(). ' + 'This is likely a bug in React. Please file an issue.');\n }\n }\n\n if (typeof type === 'function') {\n return type.displayName || type.name || null;\n }\n\n if (typeof type === 'string') {\n return type;\n }\n\n switch (type) {\n case REACT_FRAGMENT_TYPE:\n return 'Fragment';\n\n case REACT_PORTAL_TYPE:\n return 'Portal';\n\n case REACT_PROFILER_TYPE:\n return \"Profiler\";\n\n case REACT_STRICT_MODE_TYPE:\n return 'StrictMode';\n\n case REACT_SUSPENSE_TYPE:\n return 'Suspense';\n\n case REACT_SUSPENSE_LIST_TYPE:\n return 'SuspenseList';\n }\n\n if (typeof type === 'object') {\n switch (type.$$typeof) {\n case REACT_CONTEXT_TYPE:\n return 'Context.Consumer';\n\n case REACT_PROVIDER_TYPE:\n return 'Context.Provider';\n\n case REACT_FORWARD_REF_TYPE:\n return getWrappedName(type, type.render, 'ForwardRef');\n\n case REACT_MEMO_TYPE:\n return getComponentName(type.type);\n\n case REACT_LAZY_TYPE:\n {\n var thenable = type;\n var resolvedThenable = refineResolvedLazyComponent(thenable);\n\n if (resolvedThenable) {\n return getComponentName(resolvedThenable);\n }\n\n break;\n }\n }\n }\n\n return null;\n}\n\nvar ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n\nfunction describeFiber(fiber) {\n switch (fiber.tag) {\n case HostRoot:\n case HostPortal:\n case HostText:\n case Fragment:\n case ContextProvider:\n case ContextConsumer:\n return '';\n\n default:\n var owner = fiber._debugOwner;\n var source = fiber._debugSource;\n var name = getComponentName(fiber.type);\n var ownerName = null;\n\n if (owner) {\n ownerName = getComponentName(owner.type);\n }\n\n return describeComponentFrame(name, source, ownerName);\n }\n}\n\nfunction getStackByFiberInDevAndProd(workInProgress) {\n var info = '';\n var node = workInProgress;\n\n do {\n info += describeFiber(node);\n node = node.return;\n } while (node);\n\n return info;\n}\nvar current = null;\nvar phase = null;\nfunction getCurrentFiberOwnerNameInDevOrNull() {\n {\n if (current === null) {\n return null;\n }\n\n var owner = current._debugOwner;\n\n if (owner !== null && typeof owner !== 'undefined') {\n return getComponentName(owner.type);\n }\n }\n\n return null;\n}\nfunction getCurrentFiberStackInDev() {\n {\n if (current === null) {\n return '';\n } // Safe because if current fiber exists, we are reconciling,\n // and it is guaranteed to be the work-in-progress version.\n\n\n return getStackByFiberInDevAndProd(current);\n }\n\n return '';\n}\nfunction resetCurrentFiber() {\n {\n ReactDebugCurrentFrame.getCurrentStack = null;\n current = null;\n phase = null;\n }\n}\nfunction setCurrentFiber(fiber) {\n {\n ReactDebugCurrentFrame.getCurrentStack = getCurrentFiberStackInDev;\n current = fiber;\n phase = null;\n }\n}\nfunction setCurrentPhase(lifeCyclePhase) {\n {\n phase = lifeCyclePhase;\n }\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\n\nfunction endsWith(subject, search) {\n var length = subject.length;\n return subject.substring(length - search.length, length) === search;\n}\n\nvar PLUGIN_EVENT_SYSTEM = 1;\nvar RESPONDER_EVENT_SYSTEM = 1 << 1;\nvar IS_PASSIVE = 1 << 2;\nvar IS_ACTIVE = 1 << 3;\nvar PASSIVE_NOT_SUPPORTED = 1 << 4;\nvar IS_REPLAYED = 1 << 5;\n\nvar restoreImpl = null;\nvar restoreTarget = null;\nvar restoreQueue = null;\n\nfunction restoreStateOfTarget(target) {\n // We perform this translation at the end of the event loop so that we\n // always receive the correct fiber here\n var internalInstance = getInstanceFromNode(target);\n\n if (!internalInstance) {\n // Unmounted\n return;\n }\n\n (function () {\n if (!(typeof restoreImpl === 'function')) {\n {\n throw ReactError(Error(\"setRestoreImplementation() needs to be called to handle a target for controlled events. This error is likely caused by a bug in React. Please file an issue.\"));\n }\n }\n })();\n\n var props = getFiberCurrentPropsFromNode(internalInstance.stateNode);\n restoreImpl(internalInstance.stateNode, internalInstance.type, props);\n}\n\nfunction setRestoreImplementation(impl) {\n restoreImpl = impl;\n}\nfunction enqueueStateRestore(target) {\n if (restoreTarget) {\n if (restoreQueue) {\n restoreQueue.push(target);\n } else {\n restoreQueue = [target];\n }\n } else {\n restoreTarget = target;\n }\n}\nfunction needsStateRestore() {\n return restoreTarget !== null || restoreQueue !== null;\n}\nfunction restoreStateIfNeeded() {\n if (!restoreTarget) {\n return;\n }\n\n var target = restoreTarget;\n var queuedTargets = restoreQueue;\n restoreTarget = null;\n restoreQueue = null;\n restoreStateOfTarget(target);\n\n if (queuedTargets) {\n for (var i = 0; i < queuedTargets.length; i++) {\n restoreStateOfTarget(queuedTargets[i]);\n }\n }\n}\n\nvar enableUserTimingAPI = true; // Helps identify side effects in begin-phase lifecycle hooks and setState reducers:\n\nvar debugRenderPhaseSideEffects = false; // In some cases, StrictMode should also double-render lifecycles.\n// This can be confusing for tests though,\n// And it can be bad for performance in production.\n// This feature flag can be used to control the behavior:\n\nvar debugRenderPhaseSideEffectsForStrictMode = true; // To preserve the \"Pause on caught exceptions\" behavior of the debugger, we\n// replay the begin phase of a failed component inside invokeGuardedCallback.\n\nvar replayFailedUnitOfWorkWithInvokeGuardedCallback = true; // Warn about deprecated, async-unsafe lifecycles; relates to RFC #6:\n\nvar warnAboutDeprecatedLifecycles = true; // Gather advanced timing metrics for Profiler subtrees.\n\nvar enableProfilerTimer = true; // Trace which interactions trigger each commit.\n\nvar enableSchedulerTracing = true; // Only used in www builds.\n\nvar enableSuspenseServerRenderer = false; // TODO: true? Here it might just be false.\n\nvar enableSelectiveHydration = false; // Only used in www builds.\n\n // Only used in www builds.\n\n // Disable javascript: URL strings in href for XSS protection.\n\nvar disableJavaScriptURLs = false; // React Fire: prevent the value and checked attributes from syncing\n// with their related DOM properties\n\nvar disableInputAttributeSyncing = false; // These APIs will no longer be \"unstable\" in the upcoming 16.7 release,\n// Control this behavior with a flag to support 16.6 minor releases in the meanwhile.\n\nvar enableStableConcurrentModeAPIs = false;\nvar warnAboutShorthandPropertyCollision = false; // See https://github.com/react-native-community/discussions-and-proposals/issues/72 for more information\n// This is a flag so we can fix warnings in RN core before turning it on\n\n // Experimental React Flare event system and event components support.\n\nvar enableFlareAPI = false; // Experimental Host Component support.\n\nvar enableFundamentalAPI = false; // Experimental Scope support.\n\nvar enableScopeAPI = false; // New API for JSX transforms to target - https://github.com/reactjs/rfcs/pull/107\n\n // We will enforce mocking scheduler with scheduler/unstable_mock at some point. (v17?)\n// Till then, we warn about the missing mock, but still fallback to a sync mode compatible version\n\nvar warnAboutUnmockedScheduler = false; // For tests, we flush suspense fallbacks in an act scope;\n// *except* in some of our own tests, where we test incremental loading states.\n\nvar flushSuspenseFallbacksInTests = true; // Changes priority of some events like mousemove to user-blocking priority,\n// but without making them discrete. The flag exists in case it causes\n// starvation problems.\n\nvar enableUserBlockingEvents = false; // Add a callback property to suspense to notify which promises are currently\n// in the update queue. This allows reporting and tracing of what is causing\n// the user to see a loading state.\n// Also allows hydration callbacks to fire when a dehydrated boundary gets\n// hydrated or deleted.\n\nvar enableSuspenseCallback = false; // Part of the simplification of React.createElement so we can eventually move\n// from React.createElement to React.jsx\n// https://github.com/reactjs/rfcs/blob/createlement-rfc/text/0000-create-element-changes.md\n\nvar warnAboutDefaultPropsOnFunctionComponents = false;\nvar warnAboutStringRefs = false;\nvar disableLegacyContext = false;\nvar disableSchedulerTimeoutBasedOnReactExpirationTime = false;\nvar enableTrustedTypesIntegration = false;\n\n// the renderer. Such as when we're dispatching events or if third party\n// libraries need to call batchedUpdates. Eventually, this API will go away when\n// everything is batched by default. We'll then have a similar API to opt-out of\n// scheduled work and instead do synchronous work.\n// Defaults\n\nvar batchedUpdatesImpl = function (fn, bookkeeping) {\n return fn(bookkeeping);\n};\n\nvar discreteUpdatesImpl = function (fn, a, b, c) {\n return fn(a, b, c);\n};\n\nvar flushDiscreteUpdatesImpl = function () {};\n\nvar batchedEventUpdatesImpl = batchedUpdatesImpl;\nvar isInsideEventHandler = false;\nvar isBatchingEventUpdates = false;\n\nfunction finishEventHandler() {\n // Here we wait until all updates have propagated, which is important\n // when using controlled components within layers:\n // https://github.com/facebook/react/issues/1698\n // Then we restore state of any controlled component.\n var controlledComponentsHavePendingUpdates = needsStateRestore();\n\n if (controlledComponentsHavePendingUpdates) {\n // If a controlled event was fired, we may need to restore the state of\n // the DOM node back to the controlled value. This is necessary when React\n // bails out of the update without touching the DOM.\n flushDiscreteUpdatesImpl();\n restoreStateIfNeeded();\n }\n}\n\nfunction batchedUpdates(fn, bookkeeping) {\n if (isInsideEventHandler) {\n // If we are currently inside another batch, we need to wait until it\n // fully completes before restoring state.\n return fn(bookkeeping);\n }\n\n isInsideEventHandler = true;\n\n try {\n return batchedUpdatesImpl(fn, bookkeeping);\n } finally {\n isInsideEventHandler = false;\n finishEventHandler();\n }\n}\nfunction batchedEventUpdates(fn, a, b) {\n if (isBatchingEventUpdates) {\n // If we are currently inside another batch, we need to wait until it\n // fully completes before restoring state.\n return fn(a, b);\n }\n\n isBatchingEventUpdates = true;\n\n try {\n return batchedEventUpdatesImpl(fn, a, b);\n } finally {\n isBatchingEventUpdates = false;\n finishEventHandler();\n }\n} // This is for the React Flare event system\n\nfunction executeUserEventHandler(fn, value) {\n var previouslyInEventHandler = isInsideEventHandler;\n\n try {\n isInsideEventHandler = true;\n var type = typeof value === 'object' && value !== null ? value.type : '';\n invokeGuardedCallbackAndCatchFirstError(type, fn, undefined, value);\n } finally {\n isInsideEventHandler = previouslyInEventHandler;\n }\n}\nfunction discreteUpdates(fn, a, b, c) {\n var prevIsInsideEventHandler = isInsideEventHandler;\n isInsideEventHandler = true;\n\n try {\n return discreteUpdatesImpl(fn, a, b, c);\n } finally {\n isInsideEventHandler = prevIsInsideEventHandler;\n\n if (!isInsideEventHandler) {\n finishEventHandler();\n }\n }\n}\nvar lastFlushedEventTimeStamp = 0;\nfunction flushDiscreteUpdatesIfNeeded(timeStamp) {\n // event.timeStamp isn't overly reliable due to inconsistencies in\n // how different browsers have historically provided the time stamp.\n // Some browsers provide high-resolution time stamps for all events,\n // some provide low-resolution time stamps for all events. FF < 52\n // even mixes both time stamps together. Some browsers even report\n // negative time stamps or time stamps that are 0 (iOS9) in some cases.\n // Given we are only comparing two time stamps with equality (!==),\n // we are safe from the resolution differences. If the time stamp is 0\n // we bail-out of preventing the flush, which can affect semantics,\n // such as if an earlier flush removes or adds event listeners that\n // are fired in the subsequent flush. However, this is the same\n // behaviour as we had before this change, so the risks are low.\n if (!isInsideEventHandler && (!enableFlareAPI || timeStamp === 0 || lastFlushedEventTimeStamp !== timeStamp)) {\n lastFlushedEventTimeStamp = timeStamp;\n flushDiscreteUpdatesImpl();\n }\n}\nfunction setBatchingImplementation(_batchedUpdatesImpl, _discreteUpdatesImpl, _flushDiscreteUpdatesImpl, _batchedEventUpdatesImpl) {\n batchedUpdatesImpl = _batchedUpdatesImpl;\n discreteUpdatesImpl = _discreteUpdatesImpl;\n flushDiscreteUpdatesImpl = _flushDiscreteUpdatesImpl;\n batchedEventUpdatesImpl = _batchedEventUpdatesImpl;\n}\n\nvar DiscreteEvent = 0;\nvar UserBlockingEvent = 1;\nvar ContinuousEvent = 2;\n\n// CommonJS interop named imports.\n\nvar UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;\nvar runWithPriority = Scheduler.unstable_runWithPriority;\nvar listenToResponderEventTypesImpl;\nfunction setListenToResponderEventTypes(_listenToResponderEventTypesImpl) {\n listenToResponderEventTypesImpl = _listenToResponderEventTypesImpl;\n}\nvar activeTimeouts = new Map();\nvar rootEventTypesToEventResponderInstances = new Map();\nvar DoNotPropagateToNextResponder = 0;\nvar PropagateToNextResponder = 1;\nvar currentTimeStamp = 0;\nvar currentTimers = new Map();\nvar currentInstance = null;\nvar currentTimerIDCounter = 0;\nvar currentDocument = null;\nvar currentPropagationBehavior = DoNotPropagateToNextResponder;\nvar eventResponderContext = {\n dispatchEvent: function (eventValue, eventListener, eventPriority) {\n validateResponderContext();\n validateEventValue(eventValue);\n\n switch (eventPriority) {\n case DiscreteEvent:\n {\n flushDiscreteUpdatesIfNeeded(currentTimeStamp);\n discreteUpdates(function () {\n return executeUserEventHandler(eventListener, eventValue);\n });\n break;\n }\n\n case UserBlockingEvent:\n {\n if (enableUserBlockingEvents) {\n runWithPriority(UserBlockingPriority, function () {\n return executeUserEventHandler(eventListener, eventValue);\n });\n } else {\n executeUserEventHandler(eventListener, eventValue);\n }\n\n break;\n }\n\n case ContinuousEvent:\n {\n executeUserEventHandler(eventListener, eventValue);\n break;\n }\n }\n },\n isTargetWithinResponder: function (target) {\n validateResponderContext();\n\n if (target != null) {\n var fiber = getClosestInstanceFromNode(target);\n var responderFiber = currentInstance.fiber;\n\n while (fiber !== null) {\n if (fiber === responderFiber || fiber.alternate === responderFiber) {\n return true;\n }\n\n fiber = fiber.return;\n }\n }\n\n return false;\n },\n isTargetWithinResponderScope: function (target) {\n validateResponderContext();\n var componentInstance = currentInstance;\n var responder = componentInstance.responder;\n\n if (target != null) {\n var fiber = getClosestInstanceFromNode(target);\n var responderFiber = currentInstance.fiber;\n\n while (fiber !== null) {\n if (fiber === responderFiber || fiber.alternate === responderFiber) {\n return true;\n }\n\n if (doesFiberHaveResponder(fiber, responder)) {\n return false;\n }\n\n fiber = fiber.return;\n }\n }\n\n return false;\n },\n isTargetWithinNode: function (childTarget, parentTarget) {\n validateResponderContext();\n var childFiber = getClosestInstanceFromNode(childTarget);\n var parentFiber = getClosestInstanceFromNode(parentTarget);\n\n if (childFiber != null && parentFiber != null) {\n var parentAlternateFiber = parentFiber.alternate;\n var node = childFiber;\n\n while (node !== null) {\n if (node === parentFiber || node === parentAlternateFiber) {\n return true;\n }\n\n node = node.return;\n }\n\n return false;\n } // Fallback to DOM APIs\n\n\n return parentTarget.contains(childTarget);\n },\n addRootEventTypes: function (rootEventTypes) {\n validateResponderContext();\n listenToResponderEventTypesImpl(rootEventTypes, currentDocument);\n\n for (var i = 0; i < rootEventTypes.length; i++) {\n var rootEventType = rootEventTypes[i];\n var eventResponderInstance = currentInstance;\n registerRootEventType(rootEventType, eventResponderInstance);\n }\n },\n removeRootEventTypes: function (rootEventTypes) {\n validateResponderContext();\n\n for (var i = 0; i < rootEventTypes.length; i++) {\n var rootEventType = rootEventTypes[i];\n var rootEventResponders = rootEventTypesToEventResponderInstances.get(rootEventType);\n var rootEventTypesSet = currentInstance.rootEventTypes;\n\n if (rootEventTypesSet !== null) {\n rootEventTypesSet.delete(rootEventType);\n }\n\n if (rootEventResponders !== undefined) {\n rootEventResponders.delete(currentInstance);\n }\n }\n },\n setTimeout: function (func, delay) {\n validateResponderContext();\n\n if (currentTimers === null) {\n currentTimers = new Map();\n }\n\n var timeout = currentTimers.get(delay);\n var timerId = currentTimerIDCounter++;\n\n if (timeout === undefined) {\n var timers = new Map();\n var id = setTimeout(function () {\n processTimers(timers, delay);\n }, delay);\n timeout = {\n id: id,\n timers: timers\n };\n currentTimers.set(delay, timeout);\n }\n\n timeout.timers.set(timerId, {\n instance: currentInstance,\n func: func,\n id: timerId,\n timeStamp: currentTimeStamp\n });\n activeTimeouts.set(timerId, timeout);\n return timerId;\n },\n clearTimeout: function (timerId) {\n validateResponderContext();\n var timeout = activeTimeouts.get(timerId);\n\n if (timeout !== undefined) {\n var timers = timeout.timers;\n timers.delete(timerId);\n\n if (timers.size === 0) {\n clearTimeout(timeout.id);\n }\n }\n },\n getActiveDocument: getActiveDocument,\n objectAssign: _assign,\n getTimeStamp: function () {\n validateResponderContext();\n return currentTimeStamp;\n },\n isTargetWithinHostComponent: function (target, elementType) {\n validateResponderContext();\n var fiber = getClosestInstanceFromNode(target);\n\n while (fiber !== null) {\n if (fiber.tag === HostComponent && fiber.type === elementType) {\n return true;\n }\n\n fiber = fiber.return;\n }\n\n return false;\n },\n continuePropagation: function () {\n currentPropagationBehavior = PropagateToNextResponder;\n },\n enqueueStateRestore: enqueueStateRestore,\n getResponderNode: function () {\n validateResponderContext();\n var responderFiber = currentInstance.fiber;\n\n if (responderFiber.tag === ScopeComponent) {\n return null;\n }\n\n return responderFiber.stateNode;\n }\n};\n\nfunction validateEventValue(eventValue) {\n if (typeof eventValue === 'object' && eventValue !== null) {\n var target = eventValue.target,\n type = eventValue.type,\n timeStamp = eventValue.timeStamp;\n\n if (target == null || type == null || timeStamp == null) {\n throw new Error('context.dispatchEvent: \"target\", \"timeStamp\", and \"type\" fields on event object are required.');\n }\n\n var showWarning = function (name) {\n {\n warning$1(false, '%s is not available on event objects created from event responder modules (React Flare). ' + 'Try wrapping in a conditional, i.e. `if (event.type !== \"press\") { event.%s }`', name, name);\n }\n };\n\n eventValue.isDefaultPrevented = function () {\n {\n showWarning('isDefaultPrevented()');\n }\n };\n\n eventValue.isPropagationStopped = function () {\n {\n showWarning('isPropagationStopped()');\n }\n }; // $FlowFixMe: we don't need value, Flow thinks we do\n\n\n Object.defineProperty(eventValue, 'nativeEvent', {\n get: function () {\n {\n showWarning('nativeEvent');\n }\n }\n });\n }\n}\n\nfunction doesFiberHaveResponder(fiber, responder) {\n var tag = fiber.tag;\n\n if (tag === HostComponent || tag === ScopeComponent) {\n var dependencies = fiber.dependencies;\n\n if (dependencies !== null) {\n var respondersMap = dependencies.responders;\n\n if (respondersMap !== null && respondersMap.has(responder)) {\n return true;\n }\n }\n }\n\n return false;\n}\n\nfunction getActiveDocument() {\n return currentDocument;\n}\n\nfunction processTimers(timers, delay) {\n var timersArr = Array.from(timers.values());\n var previousInstance = currentInstance;\n var previousTimers = currentTimers;\n\n try {\n batchedEventUpdates(function () {\n for (var i = 0; i < timersArr.length; i++) {\n var _timersArr$i = timersArr[i],\n instance = _timersArr$i.instance,\n func = _timersArr$i.func,\n id = _timersArr$i.id,\n timeStamp = _timersArr$i.timeStamp;\n currentInstance = instance;\n currentTimeStamp = timeStamp + delay;\n\n try {\n func();\n } finally {\n activeTimeouts.delete(id);\n }\n }\n });\n } finally {\n currentTimers = previousTimers;\n currentInstance = previousInstance;\n currentTimeStamp = 0;\n }\n}\n\nfunction createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, passive, passiveSupported) {\n var _ref = nativeEvent,\n buttons = _ref.buttons,\n pointerType = _ref.pointerType;\n var eventPointerType = '';\n\n if (pointerType !== undefined) {\n eventPointerType = pointerType;\n } else if (nativeEvent.key !== undefined) {\n eventPointerType = 'keyboard';\n } else if (buttons !== undefined) {\n eventPointerType = 'mouse';\n } else if (nativeEvent.changedTouches !== undefined) {\n eventPointerType = 'touch';\n }\n\n return {\n nativeEvent: nativeEvent,\n passive: passive,\n passiveSupported: passiveSupported,\n pointerType: eventPointerType,\n target: nativeEventTarget,\n type: topLevelType\n };\n}\n\nfunction responderEventTypesContainType(eventTypes, type) {\n for (var i = 0, len = eventTypes.length; i < len; i++) {\n if (eventTypes[i] === type) {\n return true;\n }\n }\n\n return false;\n}\n\nfunction validateResponderTargetEventTypes(eventType, responder) {\n var targetEventTypes = responder.targetEventTypes; // Validate the target event type exists on the responder\n\n if (targetEventTypes !== null) {\n return responderEventTypesContainType(targetEventTypes, eventType);\n }\n\n return false;\n}\n\nfunction traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {\n var isPassiveEvent = (eventSystemFlags & IS_PASSIVE) !== 0;\n var isPassiveSupported = (eventSystemFlags & PASSIVE_NOT_SUPPORTED) === 0;\n var isPassive = isPassiveEvent || !isPassiveSupported;\n var eventType = isPassive ? topLevelType : topLevelType + '_active'; // Trigger event responders in this order:\n // - Bubble target responder phase\n // - Root responder phase\n\n var visitedResponders = new Set();\n var responderEvent = createDOMResponderEvent(topLevelType, nativeEvent, nativeEventTarget, isPassiveEvent, isPassiveSupported);\n var node = targetFiber;\n var insidePortal = false;\n\n while (node !== null) {\n var _node = node,\n dependencies = _node.dependencies,\n tag = _node.tag;\n\n if (tag === HostPortal) {\n insidePortal = true;\n } else if ((tag === HostComponent || tag === ScopeComponent) && dependencies !== null) {\n var respondersMap = dependencies.responders;\n\n if (respondersMap !== null) {\n var responderInstances = Array.from(respondersMap.values());\n\n for (var i = 0, length = responderInstances.length; i < length; i++) {\n var responderInstance = responderInstances[i];\n var props = responderInstance.props,\n responder = responderInstance.responder,\n state = responderInstance.state;\n\n if (!visitedResponders.has(responder) && validateResponderTargetEventTypes(eventType, responder) && (!insidePortal || responder.targetPortalPropagation)) {\n visitedResponders.add(responder);\n var onEvent = responder.onEvent;\n\n if (onEvent !== null) {\n currentInstance = responderInstance;\n onEvent(responderEvent, eventResponderContext, props, state);\n\n if (currentPropagationBehavior === PropagateToNextResponder) {\n visitedResponders.delete(responder);\n currentPropagationBehavior = DoNotPropagateToNextResponder;\n }\n }\n }\n }\n }\n }\n\n node = node.return;\n } // Root phase\n\n\n var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(eventType);\n\n if (rootEventResponderInstances !== undefined) {\n var _responderInstances = Array.from(rootEventResponderInstances);\n\n for (var _i = 0; _i < _responderInstances.length; _i++) {\n var _responderInstance = _responderInstances[_i];\n var props = _responderInstance.props,\n responder = _responderInstance.responder,\n state = _responderInstance.state;\n var onRootEvent = responder.onRootEvent;\n\n if (onRootEvent !== null) {\n currentInstance = _responderInstance;\n onRootEvent(responderEvent, eventResponderContext, props, state);\n }\n }\n }\n}\n\nfunction mountEventResponder(responder, responderInstance, props, state) {\n var onMount = responder.onMount;\n\n if (onMount !== null) {\n var previousInstance = currentInstance;\n var previousTimers = currentTimers;\n currentInstance = responderInstance;\n\n try {\n batchedEventUpdates(function () {\n onMount(eventResponderContext, props, state);\n });\n } finally {\n currentInstance = previousInstance;\n currentTimers = previousTimers;\n }\n }\n}\nfunction unmountEventResponder(responderInstance) {\n var responder = responderInstance.responder;\n var onUnmount = responder.onUnmount;\n\n if (onUnmount !== null) {\n var props = responderInstance.props,\n state = responderInstance.state;\n var previousInstance = currentInstance;\n var previousTimers = currentTimers;\n currentInstance = responderInstance;\n\n try {\n batchedEventUpdates(function () {\n onUnmount(eventResponderContext, props, state);\n });\n } finally {\n currentInstance = previousInstance;\n currentTimers = previousTimers;\n }\n }\n\n var rootEventTypesSet = responderInstance.rootEventTypes;\n\n if (rootEventTypesSet !== null) {\n var rootEventTypes = Array.from(rootEventTypesSet);\n\n for (var i = 0; i < rootEventTypes.length; i++) {\n var topLevelEventType = rootEventTypes[i];\n var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(topLevelEventType);\n\n if (rootEventResponderInstances !== undefined) {\n rootEventResponderInstances.delete(responderInstance);\n }\n }\n }\n}\n\nfunction validateResponderContext() {\n (function () {\n if (!(currentInstance !== null)) {\n {\n throw ReactError(Error(\"An event responder context was used outside of an event cycle. Use context.setTimeout() to use asynchronous responder context outside of event cycle .\"));\n }\n }\n })();\n}\n\nfunction dispatchEventForResponderEventSystem(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags) {\n if (enableFlareAPI) {\n var previousInstance = currentInstance;\n var previousTimers = currentTimers;\n var previousTimeStamp = currentTimeStamp;\n var previousDocument = currentDocument;\n var previousPropagationBehavior = currentPropagationBehavior;\n currentPropagationBehavior = DoNotPropagateToNextResponder;\n currentTimers = null; // nodeType 9 is DOCUMENT_NODE\n\n currentDocument = nativeEventTarget.nodeType === 9 ? nativeEventTarget : nativeEventTarget.ownerDocument; // We might want to control timeStamp another way here\n\n currentTimeStamp = nativeEvent.timeStamp;\n\n try {\n batchedEventUpdates(function () {\n traverseAndHandleEventResponderInstances(topLevelType, targetFiber, nativeEvent, nativeEventTarget, eventSystemFlags);\n });\n } finally {\n currentTimers = previousTimers;\n currentInstance = previousInstance;\n currentTimeStamp = previousTimeStamp;\n currentDocument = previousDocument;\n currentPropagationBehavior = previousPropagationBehavior;\n }\n }\n}\nfunction addRootEventTypesForResponderInstance(responderInstance, rootEventTypes) {\n for (var i = 0; i < rootEventTypes.length; i++) {\n var rootEventType = rootEventTypes[i];\n registerRootEventType(rootEventType, responderInstance);\n }\n}\n\nfunction registerRootEventType(rootEventType, eventResponderInstance) {\n var rootEventResponderInstances = rootEventTypesToEventResponderInstances.get(rootEventType);\n\n if (rootEventResponderInstances === undefined) {\n rootEventResponderInstances = new Set();\n rootEventTypesToEventResponderInstances.set(rootEventType, rootEventResponderInstances);\n }\n\n var rootEventTypesSet = eventResponderInstance.rootEventTypes;\n\n if (rootEventTypesSet === null) {\n rootEventTypesSet = eventResponderInstance.rootEventTypes = new Set();\n }\n\n (function () {\n if (!!rootEventTypesSet.has(rootEventType)) {\n {\n throw ReactError(Error(\"addRootEventTypes() found a duplicate root event type of \\\"\" + rootEventType + \"\\\". This might be because the event type exists in the event responder \\\"rootEventTypes\\\" array or because of a previous addRootEventTypes() using this root event type.\"));\n }\n }\n })();\n\n rootEventTypesSet.add(rootEventType);\n rootEventResponderInstances.add(eventResponderInstance);\n}\n\n// A reserved attribute.\n// It is handled by React separately and shouldn't be written to the DOM.\nvar RESERVED = 0; // A simple string attribute.\n// Attributes that aren't in the whitelist are presumed to have this type.\n\nvar STRING = 1; // A string attribute that accepts booleans in React. In HTML, these are called\n// \"enumerated\" attributes with \"true\" and \"false\" as possible values.\n// When true, it should be set to a \"true\" string.\n// When false, it should be set to a \"false\" string.\n\nvar BOOLEANISH_STRING = 2; // A real boolean attribute.\n// When true, it should be present (set either to an empty string or its name).\n// When false, it should be omitted.\n\nvar BOOLEAN = 3; // An attribute that can be used as a flag as well as with a value.\n// When true, it should be present (set either to an empty string or its name).\n// When false, it should be omitted.\n// For any other value, should be present with that value.\n\nvar OVERLOADED_BOOLEAN = 4; // An attribute that must be numeric or parse as a numeric.\n// When falsy, it should be removed.\n\nvar NUMERIC = 5; // An attribute that must be positive numeric or parse as a positive numeric.\n// When falsy, it should be removed.\n\nvar POSITIVE_NUMERIC = 6;\n\n/* eslint-disable max-len */\nvar ATTRIBUTE_NAME_START_CHAR = \":A-Z_a-z\\\\u00C0-\\\\u00D6\\\\u00D8-\\\\u00F6\\\\u00F8-\\\\u02FF\\\\u0370-\\\\u037D\\\\u037F-\\\\u1FFF\\\\u200C-\\\\u200D\\\\u2070-\\\\u218F\\\\u2C00-\\\\u2FEF\\\\u3001-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFFD\";\n/* eslint-enable max-len */\n\nvar ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + \"\\\\-.0-9\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040\";\n\nvar ROOT_ATTRIBUTE_NAME = 'data-reactroot';\nvar VALID_ATTRIBUTE_NAME_REGEX = new RegExp('^[' + ATTRIBUTE_NAME_START_CHAR + '][' + ATTRIBUTE_NAME_CHAR + ']*$');\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar illegalAttributeNameCache = {};\nvar validatedAttributeNameCache = {};\nfunction isAttributeNameSafe(attributeName) {\n if (hasOwnProperty.call(validatedAttributeNameCache, attributeName)) {\n return true;\n }\n\n if (hasOwnProperty.call(illegalAttributeNameCache, attributeName)) {\n return false;\n }\n\n if (VALID_ATTRIBUTE_NAME_REGEX.test(attributeName)) {\n validatedAttributeNameCache[attributeName] = true;\n return true;\n }\n\n illegalAttributeNameCache[attributeName] = true;\n\n {\n warning$1(false, 'Invalid attribute name: `%s`', attributeName);\n }\n\n return false;\n}\nfunction shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null) {\n return propertyInfo.type === RESERVED;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (name.length > 2 && (name[0] === 'o' || name[0] === 'O') && (name[1] === 'n' || name[1] === 'N')) {\n return true;\n }\n\n return false;\n}\nfunction shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag) {\n if (propertyInfo !== null && propertyInfo.type === RESERVED) {\n return false;\n }\n\n switch (typeof value) {\n case 'function': // $FlowIssue symbol is perfectly valid here\n\n case 'symbol':\n // eslint-disable-line\n return true;\n\n case 'boolean':\n {\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n return !propertyInfo.acceptsBooleans;\n } else {\n var prefix = name.toLowerCase().slice(0, 5);\n return prefix !== 'data-' && prefix !== 'aria-';\n }\n }\n\n default:\n return false;\n }\n}\nfunction shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag) {\n if (value === null || typeof value === 'undefined') {\n return true;\n }\n\n if (shouldRemoveAttributeWithWarning(name, value, propertyInfo, isCustomComponentTag)) {\n return true;\n }\n\n if (isCustomComponentTag) {\n return false;\n }\n\n if (propertyInfo !== null) {\n switch (propertyInfo.type) {\n case BOOLEAN:\n return !value;\n\n case OVERLOADED_BOOLEAN:\n return value === false;\n\n case NUMERIC:\n return isNaN(value);\n\n case POSITIVE_NUMERIC:\n return isNaN(value) || value < 1;\n }\n }\n\n return false;\n}\nfunction getPropertyInfo(name) {\n return properties.hasOwnProperty(name) ? properties[name] : null;\n}\n\nfunction PropertyInfoRecord(name, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL) {\n this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN;\n this.attributeName = attributeName;\n this.attributeNamespace = attributeNamespace;\n this.mustUseProperty = mustUseProperty;\n this.propertyName = name;\n this.type = type;\n this.sanitizeURL = sanitizeURL;\n} // When adding attributes to this list, be sure to also add them to\n// the `possibleStandardNames` module to ensure casing and incorrect\n// name warnings.\n\n\nvar properties = {}; // These props are reserved by React. They shouldn't be written to the DOM.\n\n['children', 'dangerouslySetInnerHTML', // TODO: This prevents the assignment of defaultValue to regular\n// elements (not just inputs). Now that ReactDOMInput assigns to the\n// defaultValue property -- do we need this?\n'defaultValue', 'defaultChecked', 'innerHTML', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'style'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, RESERVED, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false);\n}); // A few React string attributes have a different name.\n// This is a mapping from React prop names to the attribute names.\n\n[['acceptCharset', 'accept-charset'], ['className', 'class'], ['htmlFor', 'for'], ['httpEquiv', 'http-equiv']].forEach(function (_ref) {\n var name = _ref[0],\n attributeName = _ref[1];\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, // attributeName\n null, // attributeNamespace\n false);\n}); // These are \"enumerated\" HTML attributes that accept \"true\" and \"false\".\n// In React, we let users pass `true` and `false` even though technically\n// these aren't boolean attributes (they are coerced to strings).\n\n['contentEditable', 'draggable', 'spellCheck', 'value'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false);\n}); // These are \"enumerated\" SVG attributes that accept \"true\" and \"false\".\n// In React, we let users pass `true` and `false` even though technically\n// these aren't boolean attributes (they are coerced to strings).\n// Since these are SVG attributes, their attribute names are case-sensitive.\n\n['autoReverse', 'externalResourcesRequired', 'focusable', 'preserveAlpha'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEANISH_STRING, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false);\n}); // These are HTML boolean attributes.\n\n['allowFullScreen', 'async', // Note: there is a special case that prevents it from being written to the DOM\n// on the client side because the browsers are inconsistent. Instead we call focus().\n'autoFocus', 'autoPlay', 'controls', 'default', 'defer', 'disabled', 'disablePictureInPicture', 'formNoValidate', 'hidden', 'loop', 'noModule', 'noValidate', 'open', 'playsInline', 'readOnly', 'required', 'reversed', 'scoped', 'seamless', // Microdata\n'itemScope'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false);\n}); // These are the few React props that we set as DOM properties\n// rather than attributes. These are all booleans.\n\n['checked', // Note: `option.selected` is not updated if `select.multiple` is\n// disabled with `removeAttribute`. We have special logic for handling this.\n'multiple', 'muted', 'selected'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, BOOLEAN, true, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false);\n}); // These are HTML attributes that are \"overloaded booleans\": they behave like\n// booleans, but can also accept a string value.\n\n['capture', 'download'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, OVERLOADED_BOOLEAN, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false);\n}); // These are HTML attributes that must be positive numbers.\n\n['cols', 'rows', 'size', 'span'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, POSITIVE_NUMERIC, false, // mustUseProperty\n name, // attributeName\n null, // attributeNamespace\n false);\n}); // These are HTML attributes that must be numbers.\n\n['rowSpan', 'start'].forEach(function (name) {\n properties[name] = new PropertyInfoRecord(name, NUMERIC, false, // mustUseProperty\n name.toLowerCase(), // attributeName\n null, // attributeNamespace\n false);\n});\nvar CAMELIZE = /[\\-\\:]([a-z])/g;\n\nvar capitalize = function (token) {\n return token[1].toUpperCase();\n}; // This is a list of all SVG attributes that need special casing, namespacing,\n// or boolean value assignment. Regular attributes that just accept strings\n// and have the same names are omitted, just like in the HTML whitelist.\n// Some of these attributes can be hard to find. This list was created by\n// scrapping the MDN documentation.\n\n\n['accent-height', 'alignment-baseline', 'arabic-form', 'baseline-shift', 'cap-height', 'clip-path', 'clip-rule', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'dominant-baseline', 'enable-background', 'fill-opacity', 'fill-rule', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'glyph-name', 'glyph-orientation-horizontal', 'glyph-orientation-vertical', 'horiz-adv-x', 'horiz-origin-x', 'image-rendering', 'letter-spacing', 'lighting-color', 'marker-end', 'marker-mid', 'marker-start', 'overline-position', 'overline-thickness', 'paint-order', 'panose-1', 'pointer-events', 'rendering-intent', 'shape-rendering', 'stop-color', 'stop-opacity', 'strikethrough-position', 'strikethrough-thickness', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'text-anchor', 'text-decoration', 'text-rendering', 'underline-position', 'underline-thickness', 'unicode-bidi', 'unicode-range', 'units-per-em', 'v-alphabetic', 'v-hanging', 'v-ideographic', 'v-mathematical', 'vector-effect', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'word-spacing', 'writing-mode', 'xmlns:xlink', 'x-height'].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, null, // attributeNamespace\n false);\n}); // String SVG attributes with the xlink namespace.\n\n['xlink:actuate', 'xlink:arcrole', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type'].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, 'http://www.w3.org/1999/xlink', false);\n}); // String SVG attributes with the xml namespace.\n\n['xml:base', 'xml:lang', 'xml:space'].forEach(function (attributeName) {\n var name = attributeName.replace(CAMELIZE, capitalize);\n properties[name] = new PropertyInfoRecord(name, STRING, false, // mustUseProperty\n attributeName, 'http://www.w3.org/XML/1998/namespace', false);\n}); // These attribute exists both in HTML and SVG.\n// The attribute name is case-sensitive in SVG so we can't just use\n// the React name like we do for attributes that exist only in HTML.\n\n['tabIndex', 'crossOrigin'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n attributeName.toLowerCase(), // attributeName\n null, // attributeNamespace\n false);\n}); // These attributes accept URLs. These must not allow javascript: URLS.\n// These will also need to accept Trusted Types object in the future.\n\nvar xlinkHref = 'xlinkHref';\nproperties[xlinkHref] = new PropertyInfoRecord('xlinkHref', STRING, false, // mustUseProperty\n'xlink:href', 'http://www.w3.org/1999/xlink', true);\n['src', 'href', 'action', 'formAction'].forEach(function (attributeName) {\n properties[attributeName] = new PropertyInfoRecord(attributeName, STRING, false, // mustUseProperty\n attributeName.toLowerCase(), // attributeName\n null, // attributeNamespace\n true);\n});\n\nvar ReactDebugCurrentFrame$1 = null;\n\n{\n ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;\n} // A javascript: URL can contain leading C0 control or \\u0020 SPACE,\n// and any newline or tab are filtered out as if they're not part of the URL.\n// https://url.spec.whatwg.org/#url-parsing\n// Tab or newline are defined as \\r\\n\\t:\n// https://infra.spec.whatwg.org/#ascii-tab-or-newline\n// A C0 control is a code point in the range \\u0000 NULL to \\u001F\n// INFORMATION SEPARATOR ONE, inclusive:\n// https://infra.spec.whatwg.org/#c0-control-or-space\n\n/* eslint-disable max-len */\n\n\nvar isJavaScriptProtocol = /^[\\u0000-\\u001F ]*j[\\r\\n\\t]*a[\\r\\n\\t]*v[\\r\\n\\t]*a[\\r\\n\\t]*s[\\r\\n\\t]*c[\\r\\n\\t]*r[\\r\\n\\t]*i[\\r\\n\\t]*p[\\r\\n\\t]*t[\\r\\n\\t]*\\:/i;\nvar didWarn = false;\n\nfunction sanitizeURL(url) {\n if (disableJavaScriptURLs) {\n (function () {\n if (!!isJavaScriptProtocol.test(url)) {\n {\n throw ReactError(Error(\"React has blocked a javascript: URL as a security precaution.\" + (ReactDebugCurrentFrame$1.getStackAddendum())));\n }\n }\n })();\n } else if ( true && !didWarn && isJavaScriptProtocol.test(url)) {\n didWarn = true;\n warning$1(false, 'A future version of React will block javascript: URLs as a security precaution. ' + 'Use event handlers instead if you can. If you need to generate unsafe HTML try ' + 'using dangerouslySetInnerHTML instead. React was passed %s.', JSON.stringify(url));\n }\n}\n\n// Flow does not allow string concatenation of most non-string types. To work\n// around this limitation, we use an opaque type that can only be obtained by\n// passing the value through getToStringValue first.\nfunction toString(value) {\n return '' + value;\n}\nfunction getToStringValue(value) {\n switch (typeof value) {\n case 'boolean':\n case 'number':\n case 'object':\n case 'string':\n case 'undefined':\n return value;\n\n default:\n // function, symbol are assigned as empty strings\n return '';\n }\n}\n/** Trusted value is a wrapper for \"safe\" values which can be assigned to DOM execution sinks. */\n\n/**\n * We allow passing objects with toString method as element attributes or in dangerouslySetInnerHTML\n * and we do validations that the value is safe. Once we do validation we want to use the validated\n * value instead of the object (because object.toString may return something else on next call).\n *\n * If application uses Trusted Types we don't stringify trusted values, but preserve them as objects.\n */\nvar toStringOrTrustedType = toString;\n\nif (enableTrustedTypesIntegration && typeof trustedTypes !== 'undefined') {\n var isHTML = trustedTypes.isHTML;\n var isScript = trustedTypes.isScript;\n var isScriptURL = trustedTypes.isScriptURL; // TrustedURLs are deprecated and will be removed soon: https://github.com/WICG/trusted-types/pull/204\n\n var isURL = trustedTypes.isURL ? trustedTypes.isURL : function (value) {\n return false;\n };\n\n toStringOrTrustedType = function (value) {\n if (typeof value === 'object' && (isHTML(value) || isScript(value) || isScriptURL(value) || isURL(value))) {\n // Pass Trusted Types through.\n return value;\n }\n\n return toString(value);\n };\n}\n\n/**\n * Set attribute for a node. The attribute value can be either string or\n * Trusted value (if application uses Trusted Types).\n */\nfunction setAttribute(node, attributeName, attributeValue) {\n node.setAttribute(attributeName, attributeValue);\n}\n/**\n * Set attribute with namespace for a node. The attribute value can be either string or\n * Trusted value (if application uses Trusted Types).\n */\n\nfunction setAttributeNS(node, attributeNamespace, attributeName, attributeValue) {\n node.setAttributeNS(attributeNamespace, attributeName, attributeValue);\n}\n\n/**\n * Get the value for a property on a node. Only used in DEV for SSR validation.\n * The \"expected\" argument is used as a hint of what the expected value is.\n * Some properties have multiple equivalent values.\n */\nfunction getValueForProperty(node, name, expected, propertyInfo) {\n {\n if (propertyInfo.mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n return node[propertyName];\n } else {\n if (!disableJavaScriptURLs && propertyInfo.sanitizeURL) {\n // If we haven't fully disabled javascript: URLs, and if\n // the hydration is successful of a javascript: URL, we\n // still want to warn on the client.\n sanitizeURL('' + expected);\n }\n\n var attributeName = propertyInfo.attributeName;\n var stringValue = null;\n\n if (propertyInfo.type === OVERLOADED_BOOLEAN) {\n if (node.hasAttribute(attributeName)) {\n var value = node.getAttribute(attributeName);\n\n if (value === '') {\n return true;\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return value;\n }\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n } else if (node.hasAttribute(attributeName)) {\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n // We had an attribute but shouldn't have had one, so read it\n // for the error message.\n return node.getAttribute(attributeName);\n }\n\n if (propertyInfo.type === BOOLEAN) {\n // If this was a boolean, it doesn't matter what the value is\n // the fact that we have it is the same as the expected.\n return expected;\n } // Even if this property uses a namespace we use getAttribute\n // because we assume its namespaced name is the same as our config.\n // To use getAttributeNS we need the local name which we don't have\n // in our config atm.\n\n\n stringValue = node.getAttribute(attributeName);\n }\n\n if (shouldRemoveAttribute(name, expected, propertyInfo, false)) {\n return stringValue === null ? expected : stringValue;\n } else if (stringValue === '' + expected) {\n return expected;\n } else {\n return stringValue;\n }\n }\n }\n}\n/**\n * Get the value for a attribute on a node. Only used in DEV for SSR validation.\n * The third argument is used as a hint of what the expected value is. Some\n * attributes have multiple equivalent values.\n */\n\nfunction getValueForAttribute(node, name, expected) {\n {\n if (!isAttributeNameSafe(name)) {\n return;\n }\n\n if (!node.hasAttribute(name)) {\n return expected === undefined ? undefined : null;\n }\n\n var value = node.getAttribute(name);\n\n if (value === '' + expected) {\n return expected;\n }\n\n return value;\n }\n}\n/**\n * Sets the value for a property on a node.\n *\n * @param {DOMElement} node\n * @param {string} name\n * @param {*} value\n */\n\nfunction setValueForProperty(node, name, value, isCustomComponentTag) {\n var propertyInfo = getPropertyInfo(name);\n\n if (shouldIgnoreAttribute(name, propertyInfo, isCustomComponentTag)) {\n return;\n }\n\n if (shouldRemoveAttribute(name, value, propertyInfo, isCustomComponentTag)) {\n value = null;\n } // If the prop isn't in the special list, treat it as a simple attribute.\n\n\n if (isCustomComponentTag || propertyInfo === null) {\n if (isAttributeNameSafe(name)) {\n var _attributeName = name;\n\n if (value === null) {\n node.removeAttribute(_attributeName);\n } else {\n setAttribute(node, _attributeName, toStringOrTrustedType(value));\n }\n }\n\n return;\n }\n\n var mustUseProperty = propertyInfo.mustUseProperty;\n\n if (mustUseProperty) {\n var propertyName = propertyInfo.propertyName;\n\n if (value === null) {\n var type = propertyInfo.type;\n node[propertyName] = type === BOOLEAN ? false : '';\n } else {\n // Contrary to `setAttribute`, object properties are properly\n // `toString`ed by IE8/9.\n node[propertyName] = value;\n }\n\n return;\n } // The rest are treated as attributes with special cases.\n\n\n var attributeName = propertyInfo.attributeName,\n attributeNamespace = propertyInfo.attributeNamespace;\n\n if (value === null) {\n node.removeAttribute(attributeName);\n } else {\n var _type = propertyInfo.type;\n var attributeValue;\n\n if (_type === BOOLEAN || _type === OVERLOADED_BOOLEAN && value === true) {\n // If attribute type is boolean, we know for sure it won't be an execution sink\n // and we won't require Trusted Type here.\n attributeValue = '';\n } else {\n // `setAttribute` with objects becomes only `[object]` in IE8/9,\n // ('' + value) makes it output the correct toString()-value.\n attributeValue = toStringOrTrustedType(value);\n\n if (propertyInfo.sanitizeURL) {\n sanitizeURL(attributeValue.toString());\n }\n }\n\n if (attributeNamespace) {\n setAttributeNS(node, attributeNamespace, attributeName, attributeValue);\n } else {\n setAttribute(node, attributeName, attributeValue);\n }\n }\n}\n\nvar ReactDebugCurrentFrame$2 = null;\nvar ReactControlledValuePropTypes = {\n checkPropTypes: null\n};\n\n{\n ReactDebugCurrentFrame$2 = ReactSharedInternals.ReactDebugCurrentFrame;\n var hasReadOnlyValue = {\n button: true,\n checkbox: true,\n image: true,\n hidden: true,\n radio: true,\n reset: true,\n submit: true\n };\n var propTypes = {\n value: function (props, propName, componentName) {\n if (hasReadOnlyValue[props.type] || props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {\n return null;\n }\n\n return new Error('You provided a `value` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultValue`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n },\n checked: function (props, propName, componentName) {\n if (props.onChange || props.readOnly || props.disabled || props[propName] == null || enableFlareAPI && props.listeners) {\n return null;\n }\n\n return new Error('You provided a `checked` prop to a form field without an ' + '`onChange` handler. This will render a read-only field. If ' + 'the field should be mutable use `defaultChecked`. Otherwise, ' + 'set either `onChange` or `readOnly`.');\n }\n };\n /**\n * Provide a linked `value` attribute for controlled forms. You should not use\n * this outside of the ReactDOM controlled form components.\n */\n\n ReactControlledValuePropTypes.checkPropTypes = function (tagName, props) {\n checkPropTypes(propTypes, props, 'prop', tagName, ReactDebugCurrentFrame$2.getStackAddendum);\n };\n}\n\nfunction isCheckable(elem) {\n var type = elem.type;\n var nodeName = elem.nodeName;\n return nodeName && nodeName.toLowerCase() === 'input' && (type === 'checkbox' || type === 'radio');\n}\n\nfunction getTracker(node) {\n return node._valueTracker;\n}\n\nfunction detachTracker(node) {\n node._valueTracker = null;\n}\n\nfunction getValueFromNode(node) {\n var value = '';\n\n if (!node) {\n return value;\n }\n\n if (isCheckable(node)) {\n value = node.checked ? 'true' : 'false';\n } else {\n value = node.value;\n }\n\n return value;\n}\n\nfunction trackValueOnNode(node) {\n var valueField = isCheckable(node) ? 'checked' : 'value';\n var descriptor = Object.getOwnPropertyDescriptor(node.constructor.prototype, valueField);\n var currentValue = '' + node[valueField]; // if someone has already defined a value or Safari, then bail\n // and don't track value will cause over reporting of changes,\n // but it's better then a hard failure\n // (needed for certain tests that spyOn input values and Safari)\n\n if (node.hasOwnProperty(valueField) || typeof descriptor === 'undefined' || typeof descriptor.get !== 'function' || typeof descriptor.set !== 'function') {\n return;\n }\n\n var get = descriptor.get,\n set = descriptor.set;\n Object.defineProperty(node, valueField, {\n configurable: true,\n get: function () {\n return get.call(this);\n },\n set: function (value) {\n currentValue = '' + value;\n set.call(this, value);\n }\n }); // We could've passed this the first time\n // but it triggers a bug in IE11 and Edge 14/15.\n // Calling defineProperty() again should be equivalent.\n // https://github.com/facebook/react/issues/11768\n\n Object.defineProperty(node, valueField, {\n enumerable: descriptor.enumerable\n });\n var tracker = {\n getValue: function () {\n return currentValue;\n },\n setValue: function (value) {\n currentValue = '' + value;\n },\n stopTracking: function () {\n detachTracker(node);\n delete node[valueField];\n }\n };\n return tracker;\n}\n\nfunction track(node) {\n if (getTracker(node)) {\n return;\n } // TODO: Once it's just Fiber we can move this to node._wrapperState\n\n\n node._valueTracker = trackValueOnNode(node);\n}\nfunction updateValueIfChanged(node) {\n if (!node) {\n return false;\n }\n\n var tracker = getTracker(node); // if there is no tracker at this point it's unlikely\n // that trying again will succeed\n\n if (!tracker) {\n return true;\n }\n\n var lastValue = tracker.getValue();\n var nextValue = getValueFromNode(node);\n\n if (nextValue !== lastValue) {\n tracker.setValue(nextValue);\n return true;\n }\n\n return false;\n}\n\n// TODO: direct imports like some-package/src/* are bad. Fix me.\nvar didWarnValueDefaultValue = false;\nvar didWarnCheckedDefaultChecked = false;\nvar didWarnControlledToUncontrolled = false;\nvar didWarnUncontrolledToControlled = false;\n\nfunction isControlled(props) {\n var usesChecked = props.type === 'checkbox' || props.type === 'radio';\n return usesChecked ? props.checked != null : props.value != null;\n}\n/**\n * Implements an host component that allows setting these optional\n * props: `checked`, `value`, `defaultChecked`, and `defaultValue`.\n *\n * If `checked` or `value` are not supplied (or null/undefined), user actions\n * that affect the checked state or value will trigger updates to the element.\n *\n * If they are supplied (and not null/undefined), the rendered element will not\n * trigger updates to the element. Instead, the props must change in order for\n * the rendered element to be updated.\n *\n * The rendered element will be initialized as unchecked (or `defaultChecked`)\n * with an empty value (or `defaultValue`).\n *\n * See http://www.w3.org/TR/2012/WD-html5-20121025/the-input-element.html\n */\n\n\nfunction getHostProps(element, props) {\n var node = element;\n var checked = props.checked;\n\n var hostProps = _assign({}, props, {\n defaultChecked: undefined,\n defaultValue: undefined,\n value: undefined,\n checked: checked != null ? checked : node._wrapperState.initialChecked\n });\n\n return hostProps;\n}\nfunction initWrapperState(element, props) {\n {\n ReactControlledValuePropTypes.checkPropTypes('input', props);\n\n if (props.checked !== undefined && props.defaultChecked !== undefined && !didWarnCheckedDefaultChecked) {\n warning$1(false, '%s contains an input of type %s with both checked and defaultChecked props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the checked prop, or the defaultChecked prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n didWarnCheckedDefaultChecked = true;\n }\n\n if (props.value !== undefined && props.defaultValue !== undefined && !didWarnValueDefaultValue) {\n warning$1(false, '%s contains an input of type %s with both value and defaultValue props. ' + 'Input elements must be either controlled or uncontrolled ' + '(specify either the value prop, or the defaultValue prop, but not ' + 'both). Decide between using a controlled or uncontrolled input ' + 'element and remove one of these props. More info: ' + 'https://fb.me/react-controlled-components', getCurrentFiberOwnerNameInDevOrNull() || 'A component', props.type);\n didWarnValueDefaultValue = true;\n }\n }\n\n var node = element;\n var defaultValue = props.defaultValue == null ? '' : props.defaultValue;\n node._wrapperState = {\n initialChecked: props.checked != null ? props.checked : props.defaultChecked,\n initialValue: getToStringValue(props.value != null ? props.value : defaultValue),\n controlled: isControlled(props)\n };\n}\nfunction updateChecked(element, props) {\n var node = element;\n var checked = props.checked;\n\n if (checked != null) {\n setValueForProperty(node, 'checked', checked, false);\n }\n}\nfunction updateWrapper(element, props) {\n var node = element;\n\n {\n var controlled = isControlled(props);\n\n if (!node._wrapperState.controlled && controlled && !didWarnUncontrolledToControlled) {\n warning$1(false, 'A component is changing an uncontrolled input of type %s to be controlled. ' + 'Input elements should not switch from uncontrolled to controlled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);\n didWarnUncontrolledToControlled = true;\n }\n\n if (node._wrapperState.controlled && !controlled && !didWarnControlledToUncontrolled) {\n warning$1(false, 'A component is changing a controlled input of type %s to be uncontrolled. ' + 'Input elements should not switch from controlled to uncontrolled (or vice versa). ' + 'Decide between using a controlled or uncontrolled input ' + 'element for the lifetime of the component. More info: https://fb.me/react-controlled-components', props.type);\n didWarnControlledToUncontrolled = true;\n }\n }\n\n updateChecked(element, props);\n var value = getToStringValue(props.value);\n var type = props.type;\n\n if (value != null) {\n if (type === 'number') {\n if (value === 0 && node.value === '' || // We explicitly want to coerce to number here if possible.\n // eslint-disable-next-line\n node.value != value) {\n node.value = toString(value);\n }\n } else if (node.value !== toString(value)) {\n node.value = toString(value);\n }\n } else if (type === 'submit' || type === 'reset') {\n // Submit/reset inputs need the attribute removed completely to avoid\n // blank-text buttons.\n node.removeAttribute('value');\n return;\n }\n\n if (disableInputAttributeSyncing) {\n // When not syncing the value attribute, React only assigns a new value\n // whenever the defaultValue React prop has changed. When not present,\n // React does nothing\n if (props.hasOwnProperty('defaultValue')) {\n setDefaultValue(node, props.type, getToStringValue(props.defaultValue));\n }\n } else {\n // When syncing the value attribute, the value comes from a cascade of\n // properties:\n // 1. The value React property\n // 2. The defaultValue React property\n // 3. Otherwise there should be no change\n if (props.hasOwnProperty('value')) {\n setDefaultValue(node, props.type, value);\n } else if (props.hasOwnProperty('defaultValue')) {\n setDefaultValue(node, props.type, getToStringValue(props.defaultValue));\n }\n }\n\n if (disableInputAttributeSyncing) {\n // When not syncing the checked attribute, the attribute is directly\n // controllable from the defaultValue React property. It needs to be\n // updated as new props come in.\n if (props.defaultChecked == null) {\n node.removeAttribute('checked');\n } else {\n node.defaultChecked = !!props.defaultChecked;\n }\n } else {\n // When syncing the checked attribute, it only changes when it needs\n // to be removed, such as transitioning from a checkbox into a text input\n if (props.checked == null && props.defaultChecked != null) {\n node.defaultChecked = !!props.defaultChecked;\n }\n }\n}\nfunction postMountWrapper(element, props, isHydrating) {\n var node = element; // Do not assign value if it is already set. This prevents user text input\n // from being lost during SSR hydration.\n\n if (props.hasOwnProperty('value') || props.hasOwnProperty('defaultValue')) {\n var type = props.type;\n var isButton = type === 'submit' || type === 'reset'; // Avoid setting value attribute on submit/reset inputs as it overrides the\n // default value provided by the browser. See: #12872\n\n if (isButton && (props.value === undefined || props.value === null)) {\n return;\n }\n\n var initialValue = toString(node._wrapperState.initialValue); // Do not assign value if it is already set. This prevents user text input\n // from being lost during SSR hydration.\n\n if (!isHydrating) {\n if (disableInputAttributeSyncing) {\n var value = getToStringValue(props.value); // When not syncing the value attribute, the value property points\n // directly to the React prop. Only assign it if it exists.\n\n if (value != null) {\n // Always assign on buttons so that it is possible to assign an\n // empty string to clear button text.\n //\n // Otherwise, do not re-assign the value property if is empty. This\n // potentially avoids a DOM write and prevents Firefox (~60.0.1) from\n // prematurely marking required inputs as invalid. Equality is compared\n // to the current value in case the browser provided value is not an\n // empty string.\n if (isButton || value !== node.value) {\n node.value = toString(value);\n }\n }\n } else {\n // When syncing the value attribute, the value property should use\n // the wrapperState._initialValue property. This uses:\n //\n // 1. The value React property when present\n // 2. The defaultValue React property when present\n // 3. An empty string\n if (initialValue !== node.value) {\n node.value = initialValue;\n }\n }\n }\n\n if (disableInputAttributeSyncing) {\n // When not syncing the value attribute, assign the value attribute\n // directly from the defaultValue React property (when present)\n var defaultValue = getToStringValue(props.defaultValue);\n\n if (defaultValue != null) {\n node.defaultValue = toString(defaultValue);\n }\n } else {\n // Otherwise, the value attribute is synchronized to the property,\n // so we assign defaultValue to the same thing as the value property\n // assignment step above.\n node.defaultValue = initialValue;\n }\n } // Normally, we'd just do `node.checked = node.checked` upon initial mount, less this bug\n // this is needed to work around a chrome bug where setting defaultChecked\n // will sometimes influence the value of checked (even after detachment).\n // Reference: https://bugs.chromium.org/p/chromium/issues/detail?id=608416\n // We need to temporarily unset name to avoid disrupting radio button groups.\n\n\n var name = node.name;\n\n if (name !== '') {\n node.name = '';\n }\n\n if (disableInputAttributeSyncing) {\n // When not syncing the checked attribute, the checked property\n // never gets assigned. It must be manually set. We don't want\n // to do this when hydrating so that existing user input isn't\n // modified\n if (!isHydrating) {\n updateChecked(element, props);\n } // Only assign the checked attribute if it is defined. This saves\n // a DOM write when controlling the checked attribute isn't needed\n // (text inputs, submit/reset)\n\n\n if (props.hasOwnProperty('defaultChecked')) {\n node.defaultChecked = !node.defaultChecked;\n node.defaultChecked = !!props.defaultChecked;\n }\n } else {\n // When syncing the checked attribute, both the checked property and\n // attribute are assigned at the same time using defaultChecked. This uses:\n //\n // 1. The checked React property when present\n // 2. The defaultChecked React property when present\n // 3. Otherwise, false\n node.defaultChecked = !node.defaultChecked;\n node.defaultChecked = !!node._wrapperState.initialChecked;\n }\n\n if (name !== '') {\n node.name = name;\n }\n}\nfunction restoreControlledState$1(element, props) {\n var node = element;\n updateWrapper(node, props);\n updateNamedCousins(node, props);\n}\n\nfunction updateNamedCousins(rootNode, props) {\n var name = props.name;\n\n if (props.type === 'radio' && name != null) {\n var queryRoot = rootNode;\n\n while (queryRoot.parentNode) {\n queryRoot = queryRoot.parentNode;\n } // If `rootNode.form` was non-null, then we could try `form.elements`,\n // but that sometimes behaves strangely in IE8. We could also try using\n // `form.getElementsByName`, but that will only return direct children\n // and won't include inputs that use the HTML5 `form=` attribute. Since\n // the input might not even be in a form. It might not even be in the\n // document. Let's just use the local `querySelectorAll` to ensure we don't\n // miss anything.\n\n\n var group = queryRoot.querySelectorAll('input[name=' + JSON.stringify('' + name) + '][type=\"radio\"]');\n\n for (var i = 0; i < group.length; i++) {\n var otherNode = group[i];\n\n if (otherNode === rootNode || otherNode.form !== rootNode.form) {\n continue;\n } // This will throw if radio buttons rendered by different copies of React\n // and the same name are rendered into the same form (same as #1939).\n // That's probably okay; we don't support it just as we don't support\n // mixing React radio buttons with non-React ones.\n\n\n var otherProps = getFiberCurrentPropsFromNode$1(otherNode);\n\n (function () {\n if (!otherProps) {\n {\n throw ReactError(Error(\"ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.\"));\n }\n }\n })(); // We need update the tracked value on the named cousin since the value\n // was changed but the input saw no event or value set\n\n\n updateValueIfChanged(otherNode); // If this is a controlled radio button group, forcing the input that\n // was previously checked to update will cause it to be come re-checked\n // as appropriate.\n\n updateWrapper(otherNode, otherProps);\n }\n }\n} // In Chrome, assigning defaultValue to certain input types triggers input validation.\n// For number inputs, the display value loses trailing decimal points. For email inputs,\n// Chrome raises \"The specified value is not a valid email address\".\n//\n// Here we check to see if the defaultValue has actually changed, avoiding these problems\n// when the user is inputting text\n//\n// https://github.com/facebook/react/issues/7253\n\n\nfunction setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}\n\nvar didWarnSelectedSetOnOption = false;\nvar didWarnInvalidChild = false;\n\nfunction flattenChildren(children) {\n var content = ''; // Flatten children. We'll warn if they are invalid\n // during validateProps() which runs for hydration too.\n // Note that this would throw on non-element objects.\n // Elements are stringified (which is normally irrelevant\n // but matters for ).\n\n React.Children.forEach(children, function (child) {\n if (child == null) {\n return;\n }\n\n content += child; // Note: we don't warn about invalid children here.\n // Instead, this is done separately below so that\n // it happens during the hydration codepath too.\n });\n return content;\n}\n/**\n * Implements an