ips.templates.set('nexus.store.images',`
{{#thumb}} {{{thumb}}} {{/thumb}}

{{title}}

{{size}} {{#statusText}}· {{statusText}}{{/statusText}}

{{#status}}{{/status}}
×
`);ips.templates.set('nexus.store.imagesWrapper',`
{{{content}}}
`);; ;(function($,_,undefined){"use strict";ips.controller.register('nexus.admin.store.productoptions',{initialize:function(){var self=this;this.on('change','[data-role="field"]',this.refresh);$('input[name="p_renews_checkbox"]').change(function(){self.refresh();});if($('input[name="p_images_primary_image"]').length){$('input[name="p_images_primary_image"]:first').attr('checked',true);} this.refresh();},refresh:function(){var ids=[];$(this.scope).find('[data-role="field"]:checked').each(function(){ids.push($(this).attr('data-id'));});if($('input[name="p_renews_checkbox"]').is(':checked')){var renews=1;}else{var renews=0;} var scope=$(this.scope);ips.getAjax()(scope.attr('data-url')+'&fields='+ids.join(',')+'&renews='+renews).done(function(response){scope.find('[data-role="table"]').html(response);$(document).trigger('contentChange',[scope]);});},});}(jQuery,_));; ;(function($,_,undefined){"use strict";ips.controller.register('nexus.admin.store.productselector',{initialize:function(){this.url=$(this.scope).attr('data-url');this.on('click','[data-role="group"]',this.expandCollapse);this.on('click','[data-role="product"]',this.increaseQty);},expandCollapse:function(e){var row=$(e.currentTarget);var list=row.next();if(row.hasClass('ipsTree_open')){row.removeClass('ipsTree_open');list.hide();}else{row.addClass('ipsTree_open');list.show();if(!list.data('_childrenLoaded')){list.html(ips.templates.render('core.trees.childWrapper',{content:ips.templates.render('core.trees.loadingRow')}));ips.getAjax()(this.url+'&id='+row.attr('data-groupId')).done(function(response){list.html(response);list.data('_childrenLoaded','true');})}}},increaseQty:function(e){if(!$(e.target).is('input')){$(e.currentTarget).find('input').val(parseInt($(e.currentTarget).find('input').val())+1);}}});}(jQuery,_));;