",""]);var It=/<|?\w+;/;function Pt(t,e,i,n,r){for(var s,o,a,l,u,c,h=e.createDocumentFragment(),f=[],d=0,p=t.length;d-1)r&&r.push(s);else if(u=mt(s),o=Ot(h.appendChild(s),"script"),u&&At(o),i)for(c=0;s=o[c++];)Dt.test(s.type||"")&&i.push(s);return h}var Nt=/^([^.]*)(?:\.(.+)|)/;function Mt(){return!0}function Rt(){return!1}function Lt(t,e,i,n,r,s){var o,a;if("object"==typeof e){for(a in"string"!=typeof i&&(n=n||i,i=void 0),e)Lt(t,a,i,n,e[a],s);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),!1===r)r=Rt;else if(!r)return t;return 1===s&&(o=r,r=function(t){return T().off(t),o.apply(this,arguments)},r.guid=o.guid||(o.guid=T.guid++)),t.each((function(){T.event.add(this,e,r,n,i)}))}function jt(t,e,i){i?(at.set(t,e,!1),T.event.add(t,e,{namespace:!1,handler:function(t){var i,n=at.get(this,e);if(1&t.isTrigger&&this[e]){if(n)(T.event.special[e]||{}).delegateType&&t.stopPropagation();else if(n=a.call(arguments),at.set(this,e,n),this[e](),i=at.get(this,e),at.set(this,e,!1),n!==i)return t.stopImmediatePropagation(),t.preventDefault(),i}else n&&(at.set(this,e,T.event.trigger(n[0],n.slice(1),this)),t.stopPropagation(),t.isImmediatePropagationStopped=Mt)}})):void 0===at.get(t,e)&&T.event.add(t,e,Mt)}T.event={global:{},add:function(t,e,i,n,r){var s,o,a,l,u,c,h,f,d,p,g,m=at.get(t);if(st(t))for(i.handler&&(i=(s=i).handler,r=s.selector),r&&T.find.matchesSelector(gt,r),i.guid||(i.guid=T.guid++),(l=m.events)||(l=m.events=Object.create(null)),(o=m.handle)||(o=m.handle=function(e){return void 0!==T&&T.event.triggered!==e.type?T.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(V)||[""]).length;u--;)d=g=(a=Nt.exec(e[u])||[])[1],p=(a[2]||"").split(".").sort(),d&&(h=T.event.special[d]||{},d=(r?h.delegateType:h.bindType)||d,h=T.event.special[d]||{},c=T.extend({type:d,origType:g,data:n,handler:i,guid:i.guid,selector:r,needsContext:r&&T.expr.match.needsContext.test(r),namespace:p.join(".")},s),(f=l[d])||((f=l[d]=[]).delegateCount=0,h.setup&&!1!==h.setup.call(t,n,p,o)||t.addEventListener&&t.addEventListener(d,o)),h.add&&(h.add.call(t,c),c.handler.guid||(c.handler.guid=i.guid)),r?f.splice(f.delegateCount++,0,c):f.push(c),T.event.global[d]=!0)},remove:function(t,e,i,n,r){var s,o,a,l,u,c,h,f,d,p,g,m=at.hasData(t)&&at.get(t);if(m&&(l=m.events)){for(u=(e=(e||"").match(V)||[""]).length;u--;)if(d=g=(a=Nt.exec(e[u])||[])[1],p=(a[2]||"").split(".").sort(),d){for(h=T.event.special[d]||{},f=l[d=(n?h.delegateType:h.bindType)||d]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),o=s=f.length;s--;)c=f[s],!r&&g!==c.origType||i&&i.guid!==c.guid||a&&!a.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(f.splice(s,1),c.selector&&f.delegateCount--,h.remove&&h.remove.call(t,c));o&&!f.length&&(h.teardown&&!1!==h.teardown.call(t,p,m.handle)||T.removeEvent(t,d,m.handle),delete l[d])}else for(d in l)T.event.remove(t,d+e[u],i,n,!0);T.isEmptyObject(l)&&at.remove(t,"handle events")}},dispatch:function(t){var e,i,n,r,s,o,a=new Array(arguments.length),l=T.event.fix(t),u=(at.get(this,"events")||Object.create(null))[l.type]||[],c=T.event.special[l.type]||{};for(a[0]=l,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(s=[],o={},i=0;i-1:T.find(r,this,null,[u]).length),o[r]&&s.push(n);s.length&&a.push({elem:u,handlers:s})}return u=this,l\s*$/g;function Wt(t,e){return D(t,"table")&&D(11!==e.nodeType?e:e.firstChild,"tr")&&T(t).children("tbody")[0]||t}function Bt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function qt(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function Ut(t,e){var i,n,r,s,o,a;if(1===e.nodeType){if(at.hasData(t)&&(a=at.get(t).events))for(r in at.remove(e,"handle events"),a)for(i=0,n=a[r].length;i1&&"string"==typeof p&&!m.checkClone&&Ft.test(p))return t.each((function(r){var s=t.eq(r);g&&(e[0]=p.call(this,r,s.html())),Yt(s,e,i,n)}));if(f&&(s=(r=Pt(e,t[0].ownerDocument,!1,t,n)).firstChild,1===r.childNodes.length&&(r=s),s||n)){for(a=(o=T.map(Ot(r,"script"),Bt)).length;h0&&At(o,!l&&Ot(t,"script")),a},cleanData:function(t){for(var e,i,n,r=T.event.special,s=0;void 0!==(i=t[s]);s++)if(st(i)){if(e=i[at.expando]){if(e.events)for(n in e.events)r[n]?T.event.remove(i,n):T.removeEvent(i,n,e.handle);i[at.expando]=void 0}i[lt.expando]&&(i[lt.expando]=void 0)}}}),T.fn.extend({detach:function(t){return Vt(this,t,!0)},remove:function(t){return Vt(this,t)},text:function(t){return tt(this,(function(t){return void 0===t?T.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Yt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Wt(this,t).appendChild(t)}))},prepend:function(){return Yt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Wt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Yt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Yt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(T.cleanData(Ot(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return T.clone(this,t,e)}))},html:function(t){return tt(this,(function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!Ht.test(t)&&!St[(Et.exec(t)||["",""])[1].toLowerCase()]){t=T.htmlPrefilter(t);try{for(;i=0&&(l+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-s-l-a-.5))||0),l+u}function ce(t,e,i){var n=Qt(t),r=(!m.boxSizingReliable()||i)&&"border-box"===T.css(t,"boxSizing",!1,n),s=r,o=Zt(t,e,n),a="offset"+e[0].toUpperCase()+e.slice(1);if(Kt.test(o)){if(!i)return o;o="auto"}return(!m.boxSizingReliable()&&r||!m.reliableTrDimensions()&&D(t,"tr")||"auto"===o||!parseFloat(o)&&"inline"===T.css(t,"display",!1,n))&&t.getClientRects().length&&(r="border-box"===T.css(t,"boxSizing",!1,n),(s=a in t)&&(o=t[a])),(o=parseFloat(o)||0)+ue(t,e,i||(r?"border":"content"),s,n,o)+"px"}function he(t,e,i,n,r){return new he.prototype.init(t,e,i,n,r)}T.extend({cssHooks:{opacity:{get:function(t,e){if(e){var i=Zt(t,"opacity");return""===i?"1":i}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(t,e,i,n){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,s,o,a=rt(e),l=Xt.test(e),u=t.style;if(l||(e=re(a)),o=T.cssHooks[e]||T.cssHooks[a],void 0===i)return o&&"get"in o&&void 0!==(r=o.get(t,!1,n))?r:u[e];"string"===(s=typeof i)&&(r=dt.exec(i))&&r[1]&&(i=yt(t,e,r),s="number"),null!=i&&i==i&&("number"!==s||l||(i+=r&&r[3]||(T.cssNumber[a]?"":"px")),m.clearCloneStyle||""!==i||0!==e.indexOf("background")||(u[e]="inherit"),o&&"set"in o&&void 0===(i=o.set(t,i,n))||(l?u.setProperty(e,i):u[e]=i))}},css:function(t,e,i,n){var r,s,o,a=rt(e);return Xt.test(e)||(e=re(a)),(o=T.cssHooks[e]||T.cssHooks[a])&&"get"in o&&(r=o.get(t,!0,i)),void 0===r&&(r=Zt(t,e,n)),"normal"===r&&e in ae&&(r=ae[e]),""===i||i?(s=parseFloat(r),!0===i||isFinite(s)?s||0:r):r}}),T.each(["height","width"],(function(t,e){T.cssHooks[e]={get:function(t,i,n){if(i)return!se.test(T.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ce(t,e,n):Gt(t,oe,(function(){return ce(t,e,n)}))},set:function(t,i,n){var r,s=Qt(t),o=!m.scrollboxSize()&&"absolute"===s.position,a=(o||n)&&"border-box"===T.css(t,"boxSizing",!1,s),l=n?ue(t,e,n,a,s):0;return a&&o&&(l-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(s[e])-ue(t,e,"border",!1,s)-.5)),l&&(r=dt.exec(i))&&"px"!==(r[3]||"px")&&(t.style[e]=i,i=T.css(t,e)),le(0,i,l)}}})),T.cssHooks.marginLeft=te(m.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(Zt(t,"marginLeft"))||t.getBoundingClientRect().left-Gt(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),T.each({margin:"",padding:"",border:"Width"},(function(t,e){T.cssHooks[t+e]={expand:function(i){for(var n=0,r={},s="string"==typeof i?i.split(" "):[i];n<4;n++)r[t+pt[n]+e]=s[n]||s[n-2]||s[0];return r}},"margin"!==t&&(T.cssHooks[t+e].set=le)})),T.fn.extend({css:function(t,e){return tt(this,(function(t,e,i){var n,r,s={},o=0;if(Array.isArray(e)){for(n=Qt(t),r=e.length;o1)}}),T.Tween=he,he.prototype={constructor:he,init:function(t,e,i,n,r,s){this.elem=t,this.prop=i,this.easing=r||T.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=s||(T.cssNumber[i]?"":"px")},cur:function(){var t=he.propHooks[this.prop];return t&&t.get?t.get(this):he.propHooks._default.get(this)},run:function(t){var e,i=he.propHooks[this.prop];return this.options.duration?this.pos=e=T.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):he.propHooks._default.set(this),this}},he.prototype.init.prototype=he.prototype,he.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=T.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){T.fx.step[t.prop]?T.fx.step[t.prop](t):1!==t.elem.nodeType||!T.cssHooks[t.prop]&&null==t.elem.style[re(t.prop)]?t.elem[t.prop]=t.now:T.style(t.elem,t.prop,t.now+t.unit)}}},he.propHooks.scrollTop=he.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},T.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},T.fx=he.prototype.init,T.fx.step={};var fe,de,pe=/^(?:toggle|show|hide)$/,ge=/queueHooks$/;function me(){de&&(!1===y.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(me):n.setTimeout(me,T.fx.interval),T.fx.tick())}function ve(){return n.setTimeout((function(){fe=void 0})),fe=Date.now()}function _e(t,e){var i,n=0,r={height:t};for(e=e?1:0;n<4;n+=2-e)r["margin"+(i=pt[n])]=r["padding"+i]=t;return e&&(r.opacity=r.width=t),r}function ye(t,e,i){for(var n,r=(be.tweeners[e]||[]).concat(be.tweeners["*"]),s=0,o=r.length;s1)},removeAttr:function(t){return this.each((function(){T.removeAttr(this,t)}))}}),T.extend({attr:function(t,e,i){var n,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return void 0===t.getAttribute?T.prop(t,e,i):(1===s&&T.isXMLDoc(t)||(r=T.attrHooks[e.toLowerCase()]||(T.expr.match.bool.test(e)?we:void 0)),void 0!==i?null===i?void T.removeAttr(t,e):r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:(t.setAttribute(e,i+""),i):r&&"get"in r&&null!==(n=r.get(t,e))?n:null==(n=T.find.attr(t,e))?void 0:n)},attrHooks:{type:{set:function(t,e){if(!m.radioValue&&"radio"===e&&D(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}},removeAttr:function(t,e){var i,n=0,r=e&&e.match(V);if(r&&1===t.nodeType)for(;i=r[n++];)t.removeAttribute(i)}}),we={set:function(t,e,i){return!1===e?T.removeAttr(t,i):t.setAttribute(i,i),i}},T.each(T.expr.match.bool.source.match(/\w+/g),(function(t,e){var i=xe[e]||T.find.attr;xe[e]=function(t,e,n){var r,s,o=e.toLowerCase();return n||(s=xe[o],xe[o]=r,r=null!=i(t,e,n)?o:null,xe[o]=s),r}}));var Ce=/^(?:input|select|textarea|button)$/i,ke=/^(?:a|area)$/i;function Te(t){return(t.match(V)||[]).join(" ")}function Ee(t){return t.getAttribute&&t.getAttribute("class")||""}function De(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(V)||[]}T.fn.extend({prop:function(t,e){return tt(this,T.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[T.propFix[t]||t]}))}}),T.extend({prop:function(t,e,i){var n,r,s=t.nodeType;if(3!==s&&8!==s&&2!==s)return 1===s&&T.isXMLDoc(t)||(e=T.propFix[e]||e,r=T.propHooks[e]),void 0!==i?r&&"set"in r&&void 0!==(n=r.set(t,i,e))?n:t[e]=i:r&&"get"in r&&null!==(n=r.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){var e=T.find.attr(t,"tabindex");return e?parseInt(e,10):Ce.test(t.nodeName)||ke.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),m.optSelected||(T.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),T.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){T.propFix[this.toLowerCase()]=this})),T.fn.extend({addClass:function(t){var e,i,n,r,s,o;return v(t)?this.each((function(e){T(this).addClass(t.call(this,e,Ee(this)))})):(e=De(t)).length?this.each((function(){if(n=Ee(this),i=1===this.nodeType&&" "+Te(n)+" "){for(s=0;s-1;)i=i.replace(" "+r+" "," ");o=Te(i),n!==o&&this.setAttribute("class",o)}})):this:this.attr("class","")},toggleClass:function(t,e){var i,n,r,s,o=typeof t,a="string"===o||Array.isArray(t);return v(t)?this.each((function(i){T(this).toggleClass(t.call(this,i,Ee(this),e),e)})):"boolean"==typeof e&&a?e?this.addClass(t):this.removeClass(t):(i=De(t),this.each((function(){if(a)for(s=T(this),r=0;r-1)return!0;return!1}});var Se=/\r/g;T.fn.extend({val:function(t){var e,i,n,r=this[0];return arguments.length?(n=v(t),this.each((function(i){var r;1===this.nodeType&&(null==(r=n?t.call(this,i,T(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=T.map(r,(function(t){return null==t?"":t+""}))),(e=T.valHooks[this.type]||T.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=T.valHooks[r.type]||T.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(i=e.get(r,"value"))?i:"string"==typeof(i=r.value)?i.replace(Se,""):null==i?"":i:void 0}}),T.extend({valHooks:{option:{get:function(t){var e=T.find.attr(t,"value");return null!=e?e:Te(T.text(t))}},select:{get:function(t){var e,i,n,r=t.options,s=t.selectedIndex,o="select-one"===t.type,a=o?null:[],l=o?s+1:r.length;for(n=s<0?l:o?s:0;n-1)&&(i=!0);return i||(t.selectedIndex=-1),s}}}}),T.each(["radio","checkbox"],(function(){T.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=T.inArray(T(t).val(),e)>-1}},m.checkOn||(T.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}));var Oe=n.location,Ae={guid:Date.now()},Ie=/\?/;T.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return i=e&&e.getElementsByTagName("parsererror")[0],e&&!i||T.error("Invalid XML: "+(i?T.map(i.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Pe=/^(?:focusinfocus|focusoutblur)$/,Ne=function(t){t.stopPropagation()};T.extend(T.event,{trigger:function(t,e,i,r){var s,o,a,l,u,c,h,f,p=[i||y],g=d.call(t,"type")?t.type:t,m=d.call(t,"namespace")?t.namespace.split("."):[];if(o=f=a=i=i||y,3!==i.nodeType&&8!==i.nodeType&&!Pe.test(g+T.event.triggered)&&(g.indexOf(".")>-1&&(m=g.split("."),g=m.shift(),m.sort()),u=g.indexOf(":")<0&&"on"+g,(t=t[T.expando]?t:new T.Event(g,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=m.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:T.makeArray(e,[t]),h=T.event.special[g]||{},r||!h.trigger||!1!==h.trigger.apply(i,e))){if(!r&&!h.noBubble&&!_(i)){for(l=h.delegateType||g,Pe.test(l+g)||(o=o.parentNode);o;o=o.parentNode)p.push(o),a=o;a===(i.ownerDocument||y)&&p.push(a.defaultView||a.parentWindow||n)}for(s=0;(o=p[s++])&&!t.isPropagationStopped();)f=o,t.type=s>1?l:h.bindType||g,(c=(at.get(o,"events")||Object.create(null))[t.type]&&at.get(o,"handle"))&&c.apply(o,e),(c=u&&o[u])&&c.apply&&st(o)&&(t.result=c.apply(o,e),!1===t.result&&t.preventDefault());return t.type=g,r||t.isDefaultPrevented()||h._default&&!1!==h._default.apply(p.pop(),e)||!st(i)||u&&v(i[g])&&!_(i)&&((a=i[u])&&(i[u]=null),T.event.triggered=g,t.isPropagationStopped()&&f.addEventListener(g,Ne),i[g](),t.isPropagationStopped()&&f.removeEventListener(g,Ne),T.event.triggered=void 0,a&&(i[u]=a)),t.result}},simulate:function(t,e,i){var n=T.extend(new T.Event,i,{type:t,isSimulated:!0});T.event.trigger(n,null,e)}}),T.fn.extend({trigger:function(t,e){return this.each((function(){T.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var i=this[0];if(i)return T.event.trigger(t,e,i,!0)}});var Me=/\[\]$/,Re=/\r?\n/g,Le=/^(?:submit|button|image|reset|file)$/i,je=/^(?:input|select|textarea|keygen)/i;function He(t,e,i,n){var r;if(Array.isArray(e))T.each(e,(function(e,r){i||Me.test(t)?n(t,r):He(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,i,n)}));else if(i||"object"!==x(e))n(t,e);else for(r in e)He(t+"["+r+"]",e[r],i,n)}T.param=function(t,e){var i,n=[],r=function(t,e){var i=v(e)?e():e;n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==i?"":i)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!T.isPlainObject(t))T.each(t,(function(){r(this.name,this.value)}));else for(i in t)He(i,t[i],e,r);return n.join("&")},T.fn.extend({serialize:function(){return T.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=T.prop(this,"elements");return t?T.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!T(this).is(":disabled")&&je.test(this.nodeName)&&!Le.test(t)&&(this.checked||!Tt.test(t))})).map((function(t,e){var i=T(this).val();return null==i?null:Array.isArray(i)?T.map(i,(function(t){return{name:e.name,value:t.replace(Re,"\r\n")}})):{name:e.name,value:i.replace(Re,"\r\n")}})).get()}});var Fe=/%20/g,ze=/#.*$/,We=/([?&])_=[^&]*/,Be=/^(.*?):[ \t]*([^\r\n]*)$/gm,qe=/^(?:GET|HEAD)$/,Ue=/^\/\//,$e={},Ye={},Ve="*/".concat("*"),Ke=y.createElement("a");function Xe(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r=0,s=e.toLowerCase().match(V)||[];if(v(i))for(;n=s[r++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function Qe(t,e,i,n){var r={},s=t===Ye;function o(a){var l;return r[a]=!0,T.each(t[a]||[],(function(t,a){var u=a(e,i,n);return"string"!=typeof u||s||r[u]?s?!(l=u):void 0:(e.dataTypes.unshift(u),o(u),!1)})),l}return o(e.dataTypes[0])||!r["*"]&&o("*")}function Ge(t,e){var i,n,r=T.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&T.extend(!0,t,n),t}Ke.href=Oe.href,T.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Oe.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Oe.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ve,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":T.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Ge(Ge(t,T.ajaxSettings),e):Ge(T.ajaxSettings,t)},ajaxPrefilter:Xe($e),ajaxTransport:Xe(Ye),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var i,r,s,o,a,l,u,c,h,f,d=T.ajaxSetup({},e),p=d.context||d,g=d.context&&(p.nodeType||p.jquery)?T(p):T.event,m=T.Deferred(),v=T.Callbacks("once memory"),_=d.statusCode||{},b={},w={},x="canceled",C={readyState:0,getResponseHeader:function(t){var e;if(u){if(!o)for(o={};e=Be.exec(s);)o[e[1].toLowerCase()+" "]=(o[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=o[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?s:null},setRequestHeader:function(t,e){return null==u&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,b[t]=e),this},overrideMimeType:function(t){return null==u&&(d.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)C.always(t[C.status]);else for(e in t)_[e]=[_[e],t[e]];return this},abort:function(t){var e=t||x;return i&&i.abort(e),k(0,e),this}};if(m.promise(C),d.url=((t||d.url||Oe.href)+"").replace(Ue,Oe.protocol+"//"),d.type=e.method||e.type||d.method||d.type,d.dataTypes=(d.dataType||"*").toLowerCase().match(V)||[""],null==d.crossDomain){l=y.createElement("a");try{l.href=d.url,l.href=l.href,d.crossDomain=Ke.protocol+"//"+Ke.host!=l.protocol+"//"+l.host}catch(t){d.crossDomain=!0}}if(d.data&&d.processData&&"string"!=typeof d.data&&(d.data=T.param(d.data,d.traditional)),Qe($e,d,e,C),u)return C;for(h in(c=T.event&&d.global)&&0===T.active++&&T.event.trigger("ajaxStart"),d.type=d.type.toUpperCase(),d.hasContent=!qe.test(d.type),r=d.url.replace(ze,""),d.hasContent?d.data&&d.processData&&0===(d.contentType||"").indexOf("application/x-www-form-urlencoded")&&(d.data=d.data.replace(Fe,"+")):(f=d.url.slice(r.length),d.data&&(d.processData||"string"==typeof d.data)&&(r+=(Ie.test(r)?"&":"?")+d.data,delete d.data),!1===d.cache&&(r=r.replace(We,"$1"),f=(Ie.test(r)?"&":"?")+"_="+Ae.guid+++f),d.url=r+f),d.ifModified&&(T.lastModified[r]&&C.setRequestHeader("If-Modified-Since",T.lastModified[r]),T.etag[r]&&C.setRequestHeader("If-None-Match",T.etag[r])),(d.data&&d.hasContent&&!1!==d.contentType||e.contentType)&&C.setRequestHeader("Content-Type",d.contentType),C.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+("*"!==d.dataTypes[0]?", "+Ve+"; q=0.01":""):d.accepts["*"]),d.headers)C.setRequestHeader(h,d.headers[h]);if(d.beforeSend&&(!1===d.beforeSend.call(p,C,d)||u))return C.abort();if(x="abort",v.add(d.complete),C.done(d.success),C.fail(d.error),i=Qe(Ye,d,e,C)){if(C.readyState=1,c&&g.trigger("ajaxSend",[C,d]),u)return C;d.async&&d.timeout>0&&(a=n.setTimeout((function(){C.abort("timeout")}),d.timeout));try{u=!1,i.send(b,k)}catch(t){if(u)throw t;k(-1,t)}}else k(-1,"No Transport");function k(t,e,o,l){var h,f,y,b,w,x=e;u||(u=!0,a&&n.clearTimeout(a),i=void 0,s=l||"",C.readyState=t>0?4:0,h=t>=200&&t<300||304===t,o&&(b=function(t,e,i){for(var n,r,s,o,a=t.contents,l=t.dataTypes;"*"===l[0];)l.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in a)if(a[r]&&a[r].test(n)){l.unshift(r);break}if(l[0]in i)s=l[0];else{for(r in i){if(!l[0]||t.converters[r+" "+l[0]]){s=r;break}o||(o=r)}s=s||o}if(s)return s!==l[0]&&l.unshift(s),i[s]}(d,C,o)),!h&&T.inArray("script",d.dataTypes)>-1&&T.inArray("json",d.dataTypes)<0&&(d.converters["text script"]=function(){}),b=function(t,e,i,n){var r,s,o,a,l,u={},c=t.dataTypes.slice();if(c[1])for(o in t.converters)u[o.toLowerCase()]=t.converters[o];for(s=c.shift();s;)if(t.responseFields[s]&&(i[t.responseFields[s]]=e),!l&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),l=s,s=c.shift())if("*"===s)s=l;else if("*"!==l&&l!==s){if(!(o=u[l+" "+s]||u["* "+s]))for(r in u)if((a=r.split(" "))[1]===s&&(o=u[l+" "+a[0]]||u["* "+a[0]])){!0===o?o=u[r]:!0!==u[r]&&(s=a[0],c.unshift(a[1]));break}if(!0!==o)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(t){return{state:"parsererror",error:o?t:"No conversion from "+l+" to "+s}}}return{state:"success",data:e}}(d,b,C,h),h?(d.ifModified&&((w=C.getResponseHeader("Last-Modified"))&&(T.lastModified[r]=w),(w=C.getResponseHeader("etag"))&&(T.etag[r]=w)),204===t||"HEAD"===d.type?x="nocontent":304===t?x="notmodified":(x=b.state,f=b.data,h=!(y=b.error))):(y=x,!t&&x||(x="error",t<0&&(t=0))),C.status=t,C.statusText=(e||x)+"",h?m.resolveWith(p,[f,x,C]):m.rejectWith(p,[C,x,y]),C.statusCode(_),_=void 0,c&&g.trigger(h?"ajaxSuccess":"ajaxError",[C,d,h?f:y]),v.fireWith(p,[C,x]),c&&(g.trigger("ajaxComplete",[C,d]),--T.active||T.event.trigger("ajaxStop")))}return C},getJSON:function(t,e,i){return T.get(t,e,i,"json")},getScript:function(t,e){return T.get(t,void 0,e,"script")}}),T.each(["get","post"],(function(t,e){T[e]=function(t,i,n,r){return v(i)&&(r=r||n,n=i,i=void 0),T.ajax(T.extend({url:t,type:e,dataType:r,data:i,success:n},T.isPlainObject(t)&&t))}})),T.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),T._evalUrl=function(t,e,i){return T.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){T.globalEval(t,e,i)}})},T.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=T(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){T(this).wrapInner(t.call(this,e))})):this.each((function(){var e=T(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(i){T(this).wrapAll(e?t.call(this,i):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){T(this).replaceWith(this.childNodes)})),this}}),T.expr.pseudos.hidden=function(t){return!T.expr.pseudos.visible(t)},T.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},T.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var Je={0:200,1223:204},Ze=T.ajaxSettings.xhr();m.cors=!!Ze&&"withCredentials"in Ze,m.ajax=Ze=!!Ze,T.ajaxTransport((function(t){var e,i;if(m.cors||Ze&&!t.crossDomain)return{send:function(r,s){var o,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)a[o]=t.xhrFields[o];for(o in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(o,r[o]);e=function(t){return function(){e&&(e=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Je[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),i=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout((function(){e&&i()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),T.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),T.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return T.globalEval(t),t}}}),T.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),T.ajaxTransport("script",(function(t){var e,i;if(t.crossDomain||t.scriptAttrs)return{send:function(n,r){e=T("
+@else
+ This Criterion no longer exists
+@endif
diff --git a/resources/views/home/_prompt.blade.php b/resources/views/home/_prompt.blade.php
index f5b9255798..7208497e3e 100644
--- a/resources/views/home/_prompt.blade.php
+++ b/resources/views/home/_prompt.blade.php
@@ -3,14 +3,32 @@
Default Prompt Rewards
@if (isset($staffView) && $staffView)
For reference, these are the default rewards for this prompt. The editable section above is inclusive of these rewards.
- @if ($count)
- This user has completed this prompt {{ $count }} time{{ $count == 1 ? '' : 's' }}.
+ @if ($count['all'])
+ The user has completed this prompt {{ $count['all'] }} time{{ $count['all'] == 1 ? '' : 's' }} overall.
+ @if ($prompt->limit)
+ They have now submitted this prompt {{ $prompt->limit_period ? $count[$prompt->limit_period] : $count['all'] }} out of {{ $limit }} times
+ {{ $prompt->limit_period ? 'for this ' . strtolower($prompt->limit_period) : '' }}.
+ @endif
@endif
+
+
{{ $prompt->limit ? 'Users can submit this prompt ' . $prompt->limit . ' time(s)' : 'Users can submit this prompt an unlimited number of times' }}
+ {{ $prompt->limit_period ? ' per ' . strtolower($prompt->limit_period) : '' }}
+ {{ $prompt->limit_character ? ' per character' : '' }}.
+
@else
These are the default rewards for this prompt. The actual rewards you receive may be edited by a staff member during the approval process.
- @if ($count)
- You have completed this prompt {{ $count }} time{{ $count == 1 ? '' : 's' }}.
+ @if ($count['all'])
+ You have completed this prompt {{ $count['all'] }} time{{ $count['all'] == 1 ? '' : 's' }} overall.
+ @if ($prompt->limit)
+ You have already submitted this prompt {{ $prompt->limit_period ? $count[$prompt->limit_period] : $count['all'] }} out of {{ $limit }} times
+ {{ $prompt->limit_period ? 'for this ' . strtolower($prompt->limit_period) : '' }}.
+ @endif
@endif
+
+
{{ $prompt->limit ? 'You can submit this prompt ' . $prompt->limit . ' time(s)' : 'You can submit this prompt an unlimited number of times' }}
+ {{ $prompt->limit_period ? ' per ' . strtolower($prompt->limit_period) : '' }}
+ {{ $prompt->limit_character ? ' per character' : '' }}.
+
@endif
diff --git a/resources/views/home/_submission_form.blade.php b/resources/views/home/_submission_form.blade.php
index 8d8521ebc9..c48c9f71ce 100644
--- a/resources/views/home/_submission_form.blade.php
+++ b/resources/views/home/_submission_form.blade.php
@@ -199,3 +199,9 @@
@include('criteria._criterion_selector', ['criteria' => $criteria])
@endif
+
+
+ @if (isset($characterCriteria))
+ @include('criteria._criterion_character_selector', ['criteria' => $characterCriteria])
+ @endif
+
diff --git a/resources/views/home/create_submission.blade.php b/resources/views/home/create_submission.blade.php
index ad40082331..8ae43e1c1c 100644
--- a/resources/views/home/create_submission.blade.php
+++ b/resources/views/home/create_submission.blade.php
@@ -106,8 +106,11 @@
$rewards.load('{{ url('submissions/new/prompt') }}/' + $(this).val());
$requirementsWarning.load('{{ url('submissions/new/prompt') }}/' + $(this).val() + '/requirements');
$('#copy-calc').load('{{ url('criteria/prompt') }}/' + $(this).val());
+ $('#copy-character-calc').load('{{ url('criteria/character/prompt') }}/' + $(this).val());
if ($(this).val()) $('#criterion-section').removeClass('hide');
else $('#criterion-section').addClass('hide');
+ if ($(this).val()) $('.criterion-character-section').removeClass('hide');
+ else $('.criterion-character-section').addClass('hide');
});
if ($prompt.val()) {
diff --git a/resources/views/js/_character_select_js.blade.php b/resources/views/js/_character_select_js.blade.php
index 52498c057f..53e2058d72 100644
--- a/resources/views/js/_character_select_js.blade.php
+++ b/resources/views/js/_character_select_js.blade.php
@@ -82,5 +82,34 @@ function updateRewardNames(node, id) {
node.find('.character-item-id').attr('name', 'character_rewardable_id[' + id + '][]');
node.find('.character-table-id').attr('name', 'character_rewardable_id[' + id + '][]');
}
+
+ //start criteria
+ function loadForm(e) {
+ var id = $(this).val();
+ var promptId = $('#prompt').val();
+ var formId = $(this).attr('name').split('[')[2].replace(']', '');
+
+ if (id) {
+ var form = $(this).closest('.card').find('.form');
+ form.load("{{ url('criteria/character/') }}/" + $(this).closest('.submission-character').find('.character-code').val() + "/prompt/" + id + "/" + promptId + "/" + formId, (response, status, xhr) => {
+ if (status == "error") {
+ var msg = "Error: ";
+ console.error(msg + xhr.status + " " + xhr.statusText);
+ } else {
+ form.find('[data-toggle=tooltip]').tooltip({
+ html: true
+ });
+ form.find('[data-toggle=toggle]').bootstrapToggle();
+ }
+ });
+ }
+ }
+
+ function deleteCriterion(e) {
+ e.preventDefault();
+ var toDelete = $(this).closest('.card');
+ toDelete.remove();
+ }
+ //end criteria
});
diff --git a/resources/views/js/_loot_js.blade.php b/resources/views/js/_loot_js.blade.php
index 3284038c18..d11b60c04f 100644
--- a/resources/views/js/_loot_js.blade.php
+++ b/resources/views/js/_loot_js.blade.php
@@ -13,7 +13,7 @@
$showData = [
'isTradeable' => isset($isTradeable) && $isTradeable ? $isTradeable : false,
'showLootTables' => isset($showLootTables) && $showLootTables ? $showLootTables : false,
- 'showRaffles' => isset($showRaffles) && $showLootTables ? $showRaffles : false,
+ 'showRaffles' => isset($showRaffles) && $showRaffles ? $showRaffles : false,
];
@endphp